73 #include "LuaEngine.h"
74 #include "ElunaEventMgr.h"
115 : m_attacker(_attacker), m_victim(_victim), m_damage(_damage), m_spellInfo(_spellInfo), m_schoolMask(_schoolMask),
116 m_damageType(_damageType), m_attackType(
BASE_ATTACK), m_cleanDamage(cleanDamage)
124 : m_attacker(dmgInfo.attacker), m_victim(dmgInfo.target), m_damage(dmgInfo.damage), m_spellInfo(nullptr), m_schoolMask(
SpellSchoolMask(dmgInfo.damageSchoolMask)),
125 m_damageType(
DIRECT_DAMAGE), m_attackType(dmgInfo.attackType), m_absorb(dmgInfo.absorb), m_resist(dmgInfo.resist), m_block(dmgInfo.blocked_amount),
126 m_cleanDamage(dmgInfo.cleanDamage)
131 : m_attacker(spellNonMeleeDamage.attacker), m_victim(spellNonMeleeDamage.target), m_damage(spellNonMeleeDamage.damage),
132 m_spellInfo(spellNonMeleeDamage.spellInfo), m_schoolMask(
SpellSchoolMask(spellNonMeleeDamage.schoolMask)), m_damageType(damageType),
133 m_absorb(spellNonMeleeDamage.absorb), m_resist(spellNonMeleeDamage.resist), m_block(spellNonMeleeDamage.blocked),
134 m_cleanDamage(spellNonMeleeDamage.cleanDamage)
170 ProcEventInfo::ProcEventInfo(
Unit* actor,
Unit* actionTarget,
Unit* procTarget,
uint32 typeMask,
uint32 spellTypeMask,
uint32 spellPhaseMask,
uint32 hitMask,
Spell const* spell,
DamageInfo* damageInfo,
HealInfo* healInfo,
SpellInfo const* triggeredByAuraSpell,
int8 procAuraEffectIndex)
171 : _actor(actor), _actionTarget(actionTarget), _procTarget(procTarget), _typeMask(typeMask), _spellTypeMask(spellTypeMask), _spellPhaseMask(spellPhaseMask),
172 _hitMask(hitMask), _spell(spell), _damageInfo(damageInfo), _healInfo(healInfo), _triggeredByAuraSpell(triggeredByAuraSpell), _procAuraEffectIndex(procAuraEffectIndex)
193 #pragma warning(disable:4355)
196 m_movedByPlayer(nullptr),
197 m_lastSanctuaryTime(0),
200 m_ControlledByPlayer(false),
201 m_CreatedByPlayer(false),
202 movespline(new
Movement::MoveSpline()),
204 i_disabledAI(nullptr),
207 m_AutoRepeatFirstCast(false),
209 m_removedAurasCount(0),
214 m_vehicleKit(nullptr),
216 m_HostileRefMgr(this),
217 m_comboTarget(nullptr)
220 #pragma warning(default:4355)
364 LOG_INFO(
"misc",
"Unit::~Unit (B1)");
367 LOG_INFO(
"misc",
"Unit::~Unit (B2)");
382 LOG_INFO(
"misc",
"Unit::~Unit (A1)");
390 elunaEvents->Update(p_time);
450 bool suspendAttackTimer =
false;
459 suspendAttackTimer =
true;
466 if (!suspendAttackTimer)
501 return player->GetWeaponForAttack(
OFF_ATTACK,
true);
526 data << NewPosX << NewPosY << NewPosZ;
600 transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, &loc.
orientation);
633 float distsq = dx * dx + dy * dy + dz * dz;
636 float maxdist = dist2compare + sizefactor;
638 return distsq < maxdist * maxdist;
649 float distsq = dx * dx + dy * dy + dz * dz;
653 return distsq < maxdist * maxdist;
672 auto distsq = dx * dx + dy * dy + dz * dz;
674 return distsq <= dist * dist;
680 if (combat_reach < 0.1f)
684 if (attacker_number > 0)
692 GetAngle(obj) + (attacker_number ? (
static_cast<float>(M_PI / 2) -
static_cast<float>(M_PI) * (
float)
rand_norm()) *
float(attacker_number) / combat_reach * 0.3f : 0));
721 m_interruptMask |= (*i)->GetBase()->GetSpellInfo()->AuraInterruptFlags;
733 for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
734 if (
SpellInfo const* iterSpellProto = (*itr)->GetSpellInfo())
735 if (iterSpellProto->SpellFamilyName == familyName && iterSpellProto->SpellFamilyFlags[0] & familyFlags)
743 for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
744 if ((!excludeAura || excludeAura != (*itr)->GetSpellInfo()->Id) &&
754 excludeAura = currentChanneledSpell->GetSpellInfo()->Id;
782 victim->
GetAI()->
DamageTaken(attacker, damage, damagetype, damageSchoolMask);
789 sScriptMgr->OnDamage(attacker, victim, damage);
828 for (AuraEffectList::iterator i = vCopyDamageCopy.begin(); i != vCopyDamageCopy.end(); ++i)
831 if (!((*i)->GetBase()->IsAppliedOnTarget(victim->
GetGUID())))
834 if (((*i)->GetMiscValue() & damageSchoolMask) == 0)
837 Unit* shareDamageTarget = (*i)->GetCaster();
838 if (!shareDamageTarget)
840 SpellInfo const* spell = (*i)->GetSpellInfo();
849 shareAbsorb = shareDamage;
854 DamageInfo sharedDamageInfo(attacker, shareDamageTarget, shareDamage, spellProto, damageSchoolMask, damagetype);
856 shareAbsorb = sharedDamageInfo.
GetAbsorb();
857 shareResist = sharedDamageInfo.
GetResist();
858 shareDamage = sharedDamageInfo.
GetDamage();
865 Unit::DealDamage(attacker, shareDamageTarget, shareDamage, cleanDamage,
NODAMAGE, damageSchoolMask, spellProto,
false);
872 uint32 weaponSpeedHitFactor;
881 weaponSpeedHitFactor *= 2;
883 attacker->
RewardRage(rage_damage, weaponSpeedHitFactor,
true);
908 LOG_DEBUG(
"entities.unit",
"DealDamageStart");
911 LOG_DEBUG(
"entities.unit",
"deal dmg:%d to health:%d ", damage, health);
914 bool duel_hasEnded =
false;
915 bool duel_wasMounted =
false;
926 duel_hasEnded =
true;
942 duel_wasMounted =
true;
943 duel_hasEnded =
true;
947 if (attacker && attacker != victim)
973 if (health <= damage)
975 LOG_DEBUG(
"entities.unit",
"DealDamage: victim just died");
984 LOG_DEBUG(
"entities.unit",
"DealDamageAlive");
1001 victim->
AddThreat(attacker,
float(damage), damageSchoolMask, spellProto);
1034 if (damagetype !=
DOT)
1038 uint32 interruptFlags = spell->m_spellInfo->InterruptFlags;
1048 uint32 channelInterruptFlags = spell->m_spellInfo->ChannelInterruptFlags;
1050 spell->DelayedChannel();
1062 if (duel_wasMounted)
1075 LOG_DEBUG(
"entities.unit",
"DealDamageEnd returned %d damage", damage);
1096 if (!originalCaster && triggeredByAura)
1101 Spell* spell =
new Spell(
this, spellInfo, triggerFlags, originalCaster);
1105 for (CustomSpellValues::const_iterator itr = value->begin(); itr != value->end(); ++itr)
1112 return spell->
prepare(&targets, triggeredByAura);
1129 return CastSpell(victim, spellInfo, triggerFlags, castItem, triggeredByAura, originalCaster);
1141 return CastSpell(targets, spellInfo,
nullptr, triggerFlags, castItem, triggeredByAura, originalCaster);
1167 return CastCustomSpell(spellId, values, target, triggerFlags, castItem, triggeredByAura, originalCaster);
1182 return CastSpell(targets, spellInfo, &value, triggerFlags, castItem, triggeredByAura, originalCaster);
1221 if (!victim || !victim->
IsAlive())
1236 damageInfo->
damage = damage;
1238 bool blocked =
false;
1262 damageInfo->
damage += crit_bonus;
1265 float critPctDamageMod = 0.0f;
1277 if (critPctDamageMod != 0)
1304 resilienceReduction = damageInfo->
damage - resilienceReduction;
1305 damageInfo->
damage -= resilienceReduction;
1324 resilienceReduction = damageInfo->
damage - resilienceReduction;
1325 damageInfo->
damage -= resilienceReduction;
1348 if (damageInfo == 0)
1362 LOG_DEBUG(
"entities.unit",
"Unit::DealSpellDamage has wrong damageInfo");
1375 damageInfo->
target = victim;
1438 damageInfo->
damage = damage;
1534 float reducePercent = 1 - leveldif * 0.1f;
1560 resilienceReduction = damageInfo->
damage - resilienceReduction;
1561 damageInfo->
damage -= resilienceReduction;
1612 float percent60 = 3.0f * percent20;
1613 if (offtime > percent20 && offtime <= percent60)
1615 else if (offtime > percent60)
1617 offtime -= 2.0f * percent20;
1624 float percent60 = 3.0f * percent20;
1625 if (basetime > percent20 && basetime <= percent60)
1627 else if (basetime > percent60)
1629 basetime -= 2.0f * percent20;
1646 float Probability = 20.0f;
1650 Probability = 0.65f * victim->
getLevel() + 0.5f;
1656 Probability -= ((float)VictimDefense - AttackerMeleeSkill) * 0.1428f;
1658 if (Probability > 40.0f)
1659 Probability = 40.0f;
1674 for (AuraEffectList::const_iterator dmgShieldItr = vDamageShieldsCopy.begin(); dmgShieldItr != vDamageShieldsCopy.end(); ++dmgShieldItr)
1676 SpellInfo const* i_spellProto = (*dmgShieldItr)->GetSpellInfo();
1691 uint32 damage =
uint32(std::max(0, (*dmgShieldItr)->GetAmount()));
1693 if (
Unit* caster = (*dmgShieldItr)->GetCaster())
1712 data <<
uint32(overkill > 0 ? overkill : 0);
1755 float armor = float(victim->
GetArmor());
1767 for (AuraEffectList::const_iterator j = ResIgnoreAurasAb.begin(); j != ResIgnoreAurasAb.end(); ++j)
1770 && (*j)->IsAffectedOnSpell(spellInfo))
1771 armor = floor(
AddPct(armor, -(*j)->GetAmount()));
1775 for (AuraEffectList::const_iterator j = ResIgnoreAuras.begin(); j != ResIgnoreAuras.end(); ++j)
1778 armor = floor(
AddPct(armor, -(*j)->GetAmount()));
1786 for (AuraEffectList::const_iterator itr = armorPenAuras.begin(); itr != armorPenAuras.end(); ++itr)
1788 if ((*itr)->GetSpellInfo()->EquippedItemClass == -1)
1790 if (!spellInfo || (*itr)->IsAffectedOnSpell(spellInfo) || (*itr)->GetMiscValue() & spellInfo->
GetSchoolMask())
1791 bonusPct += (*itr)->GetAmount();
1792 else if (!(*itr)->GetMiscValue() && !(*itr)->HasSpellClassMask())
1793 bonusPct += (*itr)->GetAmount();
1798 bonusPct += (*itr)->GetAmount();
1802 float maxArmorPen = 0;
1804 maxArmorPen = float(400 + 85 * victim->
getLevel());
1806 maxArmorPen = 400 + 85 * victim->
getLevel() + 4.5f * 85 * (victim->
getLevel() - 59);
1809 maxArmorPen = std::min((armor + maxArmorPen) / 3, armor);
1813 armor -= std::min(armorPen, maxArmorPen);
1820 float levelModifier = attacker ? attacker->
getLevel() : attackerLevel;
1821 if (levelModifier > 59)
1822 levelModifier = levelModifier + (4.5f * (levelModifier - 59));
1824 float tmpvalue = 0.1f * armor / (8.5f * levelModifier + 40);
1825 tmpvalue = tmpvalue / (1.0f + tmpvalue);
1827 if (tmpvalue < 0.0f)
1829 if (tmpvalue > 0.75f)
1832 newdamage =
uint32(damage - (damage * tmpvalue));
1834 return (newdamage > 1) ? newdamage : 1;
1839 float victimResistance = float(victim->
GetResistance(schoolMask));
1856 victimResistance = 0;
1858 victimResistance = std::max(victimResistance, 0.0f);
1860 victimResistance += std::max((
float(victim->
getLevel()) -
float(owner->
getLevel())) * 5.0f, 0.0f);
1862 static uint32 const BOSS_LEVEL = 83;
1863 static float const BOSS_RESISTANCE_CONSTANT = 510.0f;
1865 float resistanceConstant = 0.0f;
1867 if (level == BOSS_LEVEL)
1868 resistanceConstant = BOSS_RESISTANCE_CONSTANT;
1870 resistanceConstant = level * 5.0f;
1872 return victimResistance / (victimResistance + resistanceConstant);
1883 if (!victim || !victim->
IsAlive() || !damage)
1893 float discreteResistProbability[11];
1894 for (
uint32 i = 0; i < 11; ++i)
1896 discreteResistProbability[i] = 0.5f - 2.5f * fabs(0.1f * i - averageResist);
1897 if (discreteResistProbability[i] < 0.0f)
1898 discreteResistProbability[i] = 0.0f;
1901 if (averageResist <= 0.1f)
1903 discreteResistProbability[0] = 1.0f - 7.5f * averageResist;
1904 discreteResistProbability[1] = 5.0f * averageResist;
1905 discreteResistProbability[2] = 2.5f * averageResist;
1910 float probabilitySum = discreteResistProbability[0];
1912 while (r >= probabilitySum && i < 10)
1913 probabilitySum += discreteResistProbability[++i];
1915 float damageResisted = float(damage * i / 10);
1922 for (AuraEffectList::const_iterator j = ResIgnoreAurasAb.begin(); j != ResIgnoreAurasAb.end(); ++j)
1923 if (((*j)->GetMiscValue() & schoolMask) && (*j)->IsAffectedOnSpell(spellInfo))
1924 AddPct(damageResisted, -(*j)->GetAmount());
1927 for (AuraEffectList::const_iterator j = ResIgnoreAuras.begin(); j != ResIgnoreAuras.end(); ++j)
1928 if ((*j)->GetMiscValue() & schoolMask)
1929 AddPct(damageResisted, -(*j)->GetAmount());
1936 uint32 armorReduction = damage - damageAfterArmor;
1937 if (armorReduction < damageResisted)
1938 damageResisted = armorReduction;
1946 float auraAbsorbMod = 0;
1950 for (AuraEffectList::const_iterator itr = AbsIgnoreAurasA.begin(); itr != AbsIgnoreAurasA.end(); ++itr)
1952 if (!((*itr)->GetMiscValue() & schoolMask))
1955 if ((*itr)->GetAmount() > auraAbsorbMod)
1956 auraAbsorbMod = float((*itr)->GetAmount());
1960 for (AuraEffectList::const_iterator itr = AbsIgnoreAurasB.begin(); itr != AbsIgnoreAurasB.end(); ++itr)
1962 if (!((*itr)->GetMiscValue() & schoolMask))
1965 if (((*itr)->GetAmount() > auraAbsorbMod) && (*itr)->IsAffectedOnSpell(spellInfo))
1966 auraAbsorbMod = float((*itr)->GetAmount());
1977 for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (dmgInfo.
GetDamage() > 0); ++itr)
1990 if (currentAbsorb < 0)
1995 bool defaultPrevented =
false;
1998 currentAbsorb = tempAbsorb;
2000 if (defaultPrevented)
2007 AddPct(currentAbsorb, -auraAbsorbMod);
2011 tempAbsorb = currentAbsorb;
2027 for (AuraEffectList::const_iterator itr = vManaShieldCopy.begin(); (itr != vManaShieldCopy.end()) && (dmgInfo.
GetDamage() > 0); ++itr)
2041 if (currentAbsorb < 0)
2044 uint32 tempAbsorb = currentAbsorb;
2046 bool defaultPrevented =
false;
2049 currentAbsorb = tempAbsorb;
2051 if (defaultPrevented)
2058 AddPct(currentAbsorb, -auraAbsorbMod);
2060 int32 manaReduction = currentAbsorb;
2064 manaReduction =
int32(
float(manaReduction) * manaMultiplier);
2069 currentAbsorb = currentAbsorb ?
int32(
float(currentAbsorb) * (
float(manaTaken) /
float(manaReduction))) : 0;
2073 tempAbsorb = currentAbsorb;
2092 for (AuraEffectList::iterator itr = vSplitDamageFlatCopy.begin(); (itr != vSplitDamageFlatCopy.end()) && (dmgInfo.
GetDamage() > 0); ++itr)
2095 if (!((*itr)->GetBase()->IsAppliedOnTarget(victim->
GetGUID())))
2098 if (!((*itr)->GetMiscValue() & schoolMask))
2102 Unit* caster = (*itr)->GetCaster();
2103 if (!caster || (caster == victim) || !caster->
IsInWorld() || !caster->
IsAlive())
2106 int32 splitDamage = (*itr)->GetAmount();
2113 uint32 splitted = splitDamage;
2114 uint32 splitted_absorb = 0;
2115 uint32 splitted_resist = 0;
2130 splitted_absorb = splittedDmgInfo.
GetAbsorb();
2131 splitted_resist = splittedDmgInfo.
GetResist();
2136 caster->
ProcDamageAndSpellFor(
true, attacker, procVictim, procEx,
BASE_ATTACK, spellInfo, splitted,
nullptr, -1,
nullptr, &splittedDmgInfo);
2139 attacker->
SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo(), splitted, schoolMask, splitted_absorb, splitted_resist,
false, 0,
false);
2148 for (AuraEffectList::iterator itr = vSplitDamagePctCopy.begin(), next; (itr != vSplitDamagePctCopy.end()) && (dmgInfo.
GetDamage() > 0); ++itr)
2156 if (!((*itr)->GetMiscValue() & schoolMask))
2160 Unit* caster = (*itr)->GetCaster();
2161 if (!caster || (caster == victim) || !caster->
IsInWorld() || !caster->
IsAlive())
2165 const SpellInfo* splitSpellInfo = (*itr)->GetSpellInfo();
2173 (*itr)->GetBase()->CallScriptEffectSplitHandlers(*itr, aurApp, dmgInfo, splitDamage);
2179 if (splitSpellInfo->
Id != 53480)
2184 uint32 splitted = splitDamage;
2185 uint32 splitted_absorb = 0;
2186 uint32 splitted_resist = 0;
2201 splitted_absorb = splittedDmgInfo.
GetAbsorb();
2202 splitted_resist = splittedDmgInfo.
GetResist();
2210 attacker->
SendSpellNonMeleeDamageLog(caster, splitSpellInfo, splitted, splitSchoolMask, splitted_absorb, splitted_resist,
false, 0,
false);
2224 int32 absorbAmount = 0;
2227 bool existExpired =
false;
2231 for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end() && absorbAmount <= healing; ++i)
2237 int32 currentAbsorb = (*i)->GetAmount();
2240 if (currentAbsorb <= 0)
2242 existExpired =
true;
2248 if (healing < currentAbsorb + absorbAmount)
2249 currentAbsorb = healing - absorbAmount;
2251 absorbAmount += currentAbsorb;
2254 (*i)->SetAmount((*i)->GetAmount() - currentAbsorb);
2256 if ((*i)->GetAmount() <= 0)
2257 existExpired =
true;
2263 for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end();)
2272 i = vHealAbsorb.begin();
2277 if (absorbAmount > 0)
2301 bool meleeAttack =
true;
2306 meleeAttack =
false;
2315 meleeSpell->
finish(
false);
2326 meleeSpell->
cast(
true);
2346 damageInfo.
attackType,
nullptr,
nullptr, -1,
nullptr, &dmgInfo);
2349 LOG_DEBUG(
"entities.unit",
"AttackerStateUpdate: (Player) %s attacked %s for %u dmg, absorbed %u, blocked %u, resisted %u.",
2352 LOG_DEBUG(
"entities.unit",
"AttackerStateUpdate: (NPC) %s attacked %s for %u dmg, absorbed %u, blocked %u, resisted %u.",
2359 if (
Unit* pet = *itr)
2360 if (pet->IsAlive() && pet->GetTypeId() ==
TYPEID_UNIT)
2361 pet->ToCreature()->AI()->OwnerAttacked(victim);
2374 if (attackers.size() <= 1)
2380 if (meleeReach <= 0)
2386 Unit *refUnit =
nullptr;
2387 uint32 validAttackers = 0;
2391 for (
const auto& otherAttacker: attackers)
2394 if (!otherAttacker || otherAttacker->GetGUID() == attacker->
GetGUID() ||
2395 !otherAttacker->IsWithinMeleeRange(
this) || otherAttacker->isMoving())
2400 float curretAngle = atan(attacker->
GetExactDist2d(otherAttacker) / meleeReach);
2401 if (minAngle == 0 || curretAngle < minAngle)
2403 minAngle = curretAngle;
2404 refUnit = otherAttacker;
2410 if (!validAttackers || !refUnit)
2416 float requiredAngle = atan(contactDist / meleeReach);
2417 float attackersAngle = atan(attacker->
GetExactDist2d(refUnit) / meleeReach);
2421 float angleTollerance = attacker->
GetMap()->
IsDungeon() ? requiredAngle - requiredAngle * tanh(validAttackers / 5.0f) : requiredAngle;
2423 if (attackersAngle > angleTollerance)
2428 double angle = atan(contactDist / meleeReach);
2430 float angularRadius =
frand(0.1f, 0.3f) + angle;
2431 int8 direction = (
urand(0, 1) ? -1 : 1);
2432 float currentAngle =
GetAngle(refUnit);
2433 float absAngle = currentAngle + angularRadius * direction;
2437 GetNearPoint(attacker, x, y, z, distance, 0.0f, absAngle);
2439 if (!
GetMap()->CanReachPositionAndGetValidCoords(
this, x, y, z,
true,
true))
2441 GetNearPoint(attacker, x, y, z, distance, 0.0f, absAngle * -1);
2443 if (!
GetMap()->CanReachPositionAndGetValidCoords(
this, x, y, z,
true,
true))
2473 if( crit_chance < 0 )
2499 sScriptMgr->OnBeforeRollMeleeOutcomeAgainst(
this, victim, attType, attackerMaxSkillValueForLevel, victimMaxSkillValueForLevel, attackerWeaponSkill, victimDefenseSkill, crit_chance, miss_chance, dodge_chance, parry_chance, block_chance);
2502 int32 skillBonus = 4 * (attackerWeaponSkill - victimMaxSkillValueForLevel);
2503 int32 sum = 0, tmp = 0;
2506 LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus);
2512 if (tmp > 0 && roll < (sum += tmp))
2514 LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: MISS");
2530 dodge_chance -=
int32(
ToPlayer()->GetExpertiseDodgeOrParryReduction(attType) * 100);
2545 && ((tmp -= skillBonus) > 0)
2546 && roll < (sum += tmp))
2548 LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum - tmp, sum);
2558 LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: attack came from behind.");
2564 parry_chance -=
int32(
ToPlayer()->GetExpertiseDodgeOrParryReduction(attType) * 100);
2577 && (tmp -= skillBonus) > 0
2578 && roll < (sum += tmp))
2580 LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum - tmp, sum);
2594 && (tmp -= skillBonus) > 0
2595 && roll < (sum += tmp))
2597 LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum - tmp, sum);
2610 int32 skill = attackerWeaponSkill;
2611 int32 maxskill = attackerMaxSkillValueForLevel;
2612 skill = (skill > maxskill) ? maxskill : skill;
2614 tmp = (10 + (victimDefenseSkill - skill)) * 100;
2615 tmp = tmp > 4000 ? 4000 : tmp;
2616 if (roll < (sum += tmp))
2618 LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum - 4000, sum);
2630 tmp = victimDefenseSkill;
2631 int32 tmpmax = victimMaxSkillValueForLevel;
2633 tmp = tmp > tmpmax ? tmpmax : tmp;
2635 tmp = attackerMaxSkillValueForLevel - tmp;
2639 tmp = tmp * 200 - 1500;
2640 if (roll < (sum += tmp))
2642 LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum - tmp, sum);
2651 if (tmp > 0 && roll < (sum += tmp))
2653 LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum - tmp, sum);
2656 LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: CRIT DISABLED)");
2662 LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: NORMAL");
2668 float minDamage = 0.0f;
2669 float maxDamage = 0.0f;
2671 if (normalized || !addTotalPct)
2694 if (minDamage > maxDamage)
2695 minDamage = maxDamage;
2698 if (maxDamage == 0.0f)
2712 float LvlPenalty = 0.0f;
2716 LvlPenalty = (20.0f - spellProto->
SpellLevel) * 3.75f;
2719 if (LvlFactor > 1.0f)
2722 return AddPct(LvlFactor, -LvlPenalty);
2734 LOG_DEBUG(
"entities.unit",
"WORLD: Sent SMSG_ATTACKSTART");
2748 LOG_DEBUG(
"entities.unit",
"WORLD: Sent SMSG_ATTACKSTOP");
2793 int32 resist_mech = 0;
2796 if (!spell->
Effects[eff].IsEffect())
2802 if (resist_mech < temp)
2824 int32 attackerWeaponSkill;
2827 attackerWeaponSkill =
getLevel() * 5;
2852 tmp += resist_chance;
2863 tmp += deflect_chance;
2902 for (AuraEffectList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
2904 if (!(*i)->IsAffectedOnSpell(spellInfo))
2906 switch ((*i)->GetMiscValue())
2918 LOG_DEBUG(
"entities.unit",
"Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
2932 dodgeChance -=
int32(
ToPlayer()->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
2951 parryChance -=
int32(
ToPlayer()->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
3006 thisLevel = std::max<int32>(thisLevel, spellInfo->
SpellLevel);
3012 modHitChance = 96 - leveldif;
3014 modHitChance = 94 - (leveldif - 2) * lchance;
3038 int32 HitChance = modHitChance * 100;
3044 HitChance +=
int32(owner->m_modSpellHitChance * 100.0f);
3049 if (HitChance < 100)
3051 else if (HitChance > 10000)
3054 int32 tmp = 10000 - HitChance;
3063 tmp += resist_chance;
3068 bool bNegativeAura =
true;
3072 if (spellInfo->
Effects[i].IsEffect() && spellInfo->
Effects[i].ApplyAuraName == 0)
3074 bNegativeAura =
false;
3098 tmp += deflect_chance;
3143 for (Unit::AuraEffectList::const_iterator i = mReflectSpellsSchool.begin(); i != mReflectSpellsSchool.end(); ++i)
3145 reflectchance += (*i)->GetAmount();
3205 return dodge > 0.0f ? dodge : 0.0f;
3212 float chance = 0.0f;
3216 if (player->CanParry())
3220 tmpitem = player->GetWeaponForAttack(
OFF_ATTACK,
true);
3223 chance = player->GetRealParry();
3237 return chance > 0.0f ? chance : 0.0f;
3242 float miss_chance = 5.00f;
3245 miss_chance += player->GetMissPercentageFromDefence();
3259 if (player->CanBlock())
3276 return block > 0.0f ? block : 0.0f;
3318 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
3320 if (
GetGUID() != (*i)->GetCasterGUID())
3323 crit += (*i)->GetAmount();
3348 Item* item = player->GetWeaponForAttack(attType,
true);
3364 ? player->GetMaxSkillValue(skill)
3365 : player->GetSkillValue(skill);
3423 if (i->second->IsExpired())
3430 if (itr->second->IsNeedClientUpdate())
3431 itr->second->ClientUpdate();
3440 if (!go->isSpawned())
3443 go->SetRespawnTime(0);
3466 static uint32 const HUNTER_AUTOSHOOT = 75;
3472 if (spellProto->
Id != HUNTER_AUTOSHOOT)
3492 if (spellProto->
Id != HUNTER_AUTOSHOOT)
3528 if (s->GetSpellInfo()->Id != 69051)
3682 return spell->GetCastTime();
3699 if (spell->GetSpellInfo()->IsMoveAllowedChannel())
3738 if (bg->GetStartTime() < 80133)
3838 LOG_INFO(
"misc",
"SafeUnitPointer::UnitDeleted !!!");
3843 LOG_INFO(
"misc",
"SafeUnitPointer::UnitDeleted (A1) - %s, %u, %u, %u, %u, %u, %u, %u",
3844 p->GetGUID().ToString().c_str(), p->GetMapId(), p->GetInstanceId(), p->FindMap()->GetId(), p->IsInWorld() ? 1 : 0, p->IsDuringRemoveFromWorld() ? 1 : 0, p->IsBeingTeleported() ? 1 : 0, p->isBeingLoaded() ? 1 : 0);
3846 LOG_INFO(
"misc",
"SafeUnitPointer::UnitDeleted (A2)");
3848 p->GetSession()->KickPlayer(
"Unit deleted");
3852 LOG_INFO(
"misc",
"SafeUnitPointer::UnitDeleted (B1)");
3862 (*itr)->UnitDeleted();
3884 ASSERT(casterGUID || caster);
3886 casterGUID = caster->
GetGUID();
3898 castItemGUID = castItem->
GetGUID();
3906 if (effMask != foundAura->GetEffectMask())
3912 if (!foundAura->HasEffect(i))
3917 bp = *(baseAmount + i);
3919 bp = foundAura->GetSpellInfo()->Effects[i].BasePoints;
3921 int32* oldBP =
const_cast<int32*
>(&(foundAura->GetEffect(i)->m_baseAmount));
3926 if (castItemGUID != foundAura->GetCastItemGUID())
3929 *oldGUID = castItemGUID;
3964 for (Unit::AuraList::iterator itr = scAuras.begin(); itr != scAuras.end();)
3966 if ((*itr) != aura &&
3970 itr = scAuras.begin();
4001 m_appliedAuras.insert(AuraApplicationMap::value_type(aurId, aurApp));
4092 LOG_DEBUG(
"spells.aura",
"Aura %u now is remove mode %d", aura->
GetId(), removeMode);
4112 bool auraStateFound =
false;
4116 bool canBreak =
false;
4118 for (AuraStateAurasMap::iterator itr =
m_auraStateAuras.lower_bound(auraState); itr !=
m_auraStateAuras.upper_bound(auraState) && !(auraStateFound && canBreak);)
4120 if (itr->second == aurApp)
4127 auraStateFound =
true;
4153 if (!auraStateFound)
4171 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
4173 if (iter->second == aurApp)
4194 bool remove =
false;
4224 Aura* aura = i->second;
4246 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask) && (!casterGUID || itr->second->GetCasterGUID() == casterGUID))
4265 for (AuraMap::iterator itr = range.first; itr != range.second; ++itr)
4267 if (itr->second == aura)
4280 for (AuraMap::const_iterator itr = range.first; itr != range.second; ++itr)
4282 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask)
4283 && (!casterGUID || itr->second->GetCasterGUID() == casterGUID)
4284 && (!itemCasterGUID || itr->second->GetCastItemGUID() == itemCasterGUID)
4285 && (!except || except != itr->second))
4305 sScriptMgr->OnAuraRemove(
this, aurApp, mode);
4311 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
4313 Aura const* aura = iter->second->GetBase();
4348 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
4350 if (aurApp == iter->second)
4372 if (check(iter->second))
4385 if (check(iter->second))
4398 if (check(iter->second))
4411 if (check(iter->second))
4424 Aura const* aura = iter->second->GetBase();
4439 for (AuraMap::iterator iter = range.first; iter != range.second;)
4441 Aura* aura = iter->second;
4456 for (AuraMap::iterator iter = range.first; iter != range.second;)
4458 Aura* aura = iter->second;
4461 DispelInfo dispelInfo(dispeller, dispellerSpellId, chargesRemoved);
4487 noxious->SetDuration(aura->
GetDuration() * aureff->GetAmount() / 100);
4489 if (
const std::vector<int32>* spell_triggered =
sSpellMgr->GetSpellLinked(-
int32(aura->
GetId())))
4490 for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
4520 for (AuraMap::iterator iter = range.first; iter != range.second;)
4522 Aura* aura = iter->second;
4528 uint8 recalculateMask = 0;
4536 effMask |= (1 << i);
4538 recalculateMask |= (1 << i);
4554 oldAura->ModCharges(1);
4556 oldAura->ModStackAmount(1);
4557 oldAura->SetDuration(
int32(dur));
4571 if (newAura->IsSingleTarget())
4580 newAura->ApplyForTargets();
4600 if (iter->second->GetBase()->GetCastItemGUID() == castItemGuid)
4616 for (AuraEffectList::iterator iter =
m_modAuras[auraType].begin(); iter !=
m_modAuras[auraType].end();)
4618 Aura* aura = (*iter)->GetBase();
4622 if (aura != except && (!casterGUID || aura->
GetCasterGUID() == casterGUID)
4637 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
4658 Aura const* aura = iter->second;
4668 for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
4674 iter = scAuras.begin();
4689 Aura* aura = (*iter)->GetBase();
4703 && (spell->m_spellInfo->ChannelInterruptFlags & flag)
4704 && spell->m_spellInfo->Id != except)
4714 Aura const* aura = iter->second->GetBase();
4736 Aura const* aura = iter->second->GetBase();
4756 Aura const* aura = iter->second->GetBase();
4757 if (!except || aura->
GetId() != except)
4774 Aura const* aura = iter->second->GetBase();
4790 Aura* aura = iter->second;
4793 for (Aura::ApplicationMap::const_iterator itr = appMap.begin(); itr != appMap.end();)
4809 if (iter->second->GetBase()->GetOwner() !=
this)
4824 AuraApplicationMap::iterator aurAppIter;
4828 AuraMap::iterator aurIter;
4854 Aura const* aura = iter->second->GetBase();
4863 Aura* aura = iter->second;
4875 Aura const* aura = iter->second->GetBase();
4884 Aura* aura = iter->second;
4896 Aura const* aura = iter->second->GetBase();
4905 Aura* aura = iter->second;
4940 Aura const* aura = iter->second->GetBase();
4949 Aura* aura = iter->second;
4960 for (; range.first != range.second; ++range.first)
4962 Aura* aura = range.first->second;
4992 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4994 if (itr->second->HasEffect(effIndex)
4995 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
4997 return itr->second->GetBase()->GetEffect(effIndex);
5010 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
5018 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
5020 if (effIndex != (*itr)->GetEffIndex())
5022 SpellInfo const* spell = (*itr)->GetSpellInfo();
5032 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
5034 SpellInfo const* spell = (*i)->GetSpellInfo();
5037 if (casterGUID && (*i)->GetCasterGUID() != casterGUID)
5048 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
5050 if ((*itr)->GetId() == spellid)
5060 for (; range.first != range.second; ++range.first)
5068 && (!except || except != app))
5079 return aurApp ? aurApp->
GetBase() :
nullptr;
5089 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
5097 return aurApp ? aurApp->
GetBase() :
nullptr;
5118 if (factionEntry->CanBeSetAtWar())
5120 positive = !casterPlayer->GetReputationMgr().IsAtWar(factionEntry);
5128 for (Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
5130 Aura* aura = itr->second->GetBase();
5142 if (itr->second->IsPositive() == positive)
5152 dispelList.push_back(std::make_pair(aura, charges));
5160 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
5162 if (itr->second->HasEffect(effIndex)
5163 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
5176 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
5178 if (itr->second->GetBase()->GetStackAmount() == 0)
5181 count += (
uint32)itr->second->GetBase()->GetStackAmount();
5202 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5203 if (caster == (*i)->GetCasterGUID())
5211 for (AuraEffectList::const_iterator i = mAuraList.begin(); i != mAuraList.end(); ++i)
5212 if( (*i)->GetBase()->CanBeSentToClient() )
5221 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5222 if (miscvalue == (*i)->GetMiscValue())
5230 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5231 if ((*i)->IsAffectedOnSpell(affectedSpell))
5239 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5240 if (value == (*i)->GetAmount())
5251 if (!(*iter)->IsPositive() && (*iter)->GetBase()->GetSpellInfo()->AuraInterruptFlags & flag && (!guid || (*iter)->GetBase()->GetCasterGUID() == guid))
5261 Aura const* aura = iter->second->GetBase();
5272 SpellInfo const* spellInfo = iter->second->GetBase()->GetSpellInfo();
5277 if (iter->second->HasEffect(i) && spellInfo->
Effects[i].Effect && spellInfo->
Effects[i].Mechanic)
5278 if (mechanicMask & (1 << spellInfo->
Effects[i].Mechanic))
5288 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
5290 if ((*i)->GetMiscValue() == script)
5291 if ((*i)->IsAffectedOnSpell(spell))
5299 static const AuraType diseaseAuraTypes[] =
5309 drwGUID = playerCaster->getRuneWeaponGUID();
5314 for (AuraEffectList::iterator i =
m_modAuras[diseaseAuraTypes[index]].begin(); i !=
m_modAuras[diseaseAuraTypes[index]].end();)
5318 && ((*i)->GetCasterGUID() == casterGUID || (*i)->GetCasterGUID() == drwGUID))
5324 RemoveAura((*i)->GetId(), (*i)->GetCasterGUID());
5325 i =
m_modAuras[diseaseAuraTypes[index]].begin();
5331 Aura* aura = (*i)->GetBase();
5345 static const AuraType diseaseAuraTypes[] =
5356 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
5359 if ((*i)->GetCasterGUID() == casterGUID)
5369 int32 areaModifier = 0;
5372 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5374 if ((*i)->GetSpellInfo()->HasAreaAuraEffect())
5376 if (areaModifier < (*i)->GetAmount())
5377 areaModifier = (*i)->GetAmount();
5380 modifier += (*i)->GetAmount();
5383 return modifier + areaModifier;
5389 if (mTotalAuraList.empty())
5394 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5395 modifier += (*i)->GetAmount();
5402 float multiplier = 1.0f;
5405 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5406 AddPct(multiplier, (*i)->GetAmount());
5416 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5418 if ((*i)->GetAmount() > modifier)
5419 modifier = (*i)->GetAmount();
5430 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5431 if ((*i)->GetAmount() < modifier)
5432 modifier = (*i)->GetAmount();
5442 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5444 if ((*i)->GetMiscValue()& misc_mask)
5445 modifier += (*i)->GetAmount();
5452 float multiplier = 1.0f;
5455 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5456 if (((*i)->GetMiscValue() & misc_mask))
5457 AddPct(multiplier, (*i)->GetAmount());
5467 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5469 if (except != (*i) && (*i)->
GetMiscValue()& misc_mask && (*i)->GetAmount() > modifier)
5470 modifier = (*i)->GetAmount();
5481 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5483 if ((*i)->GetMiscValue()& misc_mask && (*i)->GetAmount() < modifier)
5484 modifier = (*i)->GetAmount();
5495 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5496 if ((*i)->GetMiscValue() == misc_value)
5497 modifier += (*i)->GetAmount();
5504 float multiplier = 1.0f;
5507 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5508 if ((*i)->GetMiscValue() == misc_value)
5509 AddPct(multiplier, (*i)->GetAmount());
5519 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5521 if ((*i)->GetMiscValue() == misc_value && (*i)->GetAmount() > modifier)
5522 modifier = (*i)->GetAmount();
5533 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5535 if ((*i)->GetMiscValue() == misc_value && (*i)->GetAmount() < modifier)
5536 modifier = (*i)->GetAmount();
5547 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5548 if ((*i)->IsAffectedOnSpell(affectedSpell))
5549 modifier += (*i)->GetAmount();
5556 float multiplier = 1.0f;
5559 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5560 if ((*i)->IsAffectedOnSpell(affectedSpell))
5561 AddPct(multiplier, (*i)->GetAmount());
5571 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5573 if ((*i)->IsAffectedOnSpell(affectedSpell) && (*i)->GetAmount() > modifier)
5574 modifier = (*i)->GetAmount();
5585 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
5587 if ((*i)->IsAffectedOnSpell(affectedSpell) && (*i)->GetAmount() < modifier)
5588 modifier = (*i)->GetAmount();
5608 for (DynObjectList::const_iterator i =
m_dynObj.begin(); i !=
m_dynObj.end(); ++i)
5642 for (GameObjectList::const_iterator itr =
m_gameObj.begin(); itr !=
m_gameObj.end(); ++itr)
5644 if (go->GetSpellId() == spellId)
5717 if (spellid > 0 && go->GetSpellId() != spellid)
5726 go->SetRespawnTime(0);
5769 data <<
uint32(overkill > 0 ? overkill : 0);
5797 data <<
uint32(overkill > 0 ? overkill : 0);
5813 log.
absorb = AbsorbedDamage;
5823 void Unit::ProcDamageAndSpell(
Unit* victim,
uint32 procAttacker,
uint32 procVictim,
uint32 procExtra,
uint32 amount,
WeaponAttackType attType,
SpellInfo const* procSpellInfo,
SpellInfo const* procAura,
int8 procAuraEffectIndex,
Spell const* procSpell,
DamageInfo* damageInfo,
HealInfo* healInfo)
5827 ProcDamageAndSpellFor(
false, victim, procAttacker, procExtra, attType, procSpellInfo, amount, procAura, procAuraEffectIndex, procSpell, damageInfo, healInfo);
5830 if (victim && victim->
IsAlive() && procVictim)
5831 victim->
ProcDamageAndSpellFor(
true,
this, procVictim, procExtra, attType, procSpellInfo, amount, procAura, procAuraEffectIndex, procSpell, damageInfo, healInfo);
5899 data <<
uint8(missInfo);
5926 LOG_DEBUG(
"entities.unit",
"WORLD: Sending SMSG_ATTACKERSTATEUPDATE");
5938 size_t maxsize = 4 + 5 + 5 + 4 + 4 + 1 + 4 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4 + 4 + 4 * 12;
5945 data <<
uint32(overkill < 0 ? 0 : overkill);
5946 data <<
uint8(count);
5948 for (
uint32 i = 0; i < count; ++i)
5951 data << float(damage);
5957 for (
uint32 i = 0; i < count; ++i)
5963 for (
uint32 i = 0; i < count; ++i)
6003 dmgInfo.
damage = Damage - AbsorbDamage - Resist - BlockedAmount;
6005 dmgInfo.
absorb = AbsorbDamage;
6022 uint32 triggered_spell_id = 0;
6023 uint32 cooldown_spell_id = 0;
6025 Unit* target = victim;
6026 int32 basepoints0 = 0;
6033 switch (dummySpell->
Id)
6038 triggered_spell_id = 58427;
6044 if (!procSpell || procSpell->
Id == 24659)
6064 triggered_spell_id = 33494;
6069 triggered_spell_id = 21064;
6074 basepoints0 = 3 * damage;
6075 if (basepoints0 < 0)
6078 triggered_spell_id = 31285;
6104 triggered_spell_id =
RAND(39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409);
6105 cooldown_spell_id = 39511;
6110 triggered_spell_id =
RAND(39511, 40997, 40998, 41002, 41005, 41011);
6111 cooldown_spell_id = 39511;
6117 triggered_spell_id =
RAND(40999, 41002, 41005, 41009, 41011, 41406, 41409);
6118 cooldown_spell_id = 40999;
6121 triggered_spell_id =
RAND(40997, 40999, 41002, 41005, 41009, 41011, 41406, 41409);
6122 cooldown_spell_id = 40997;
6151 triggered_spell_id = 45479;
6171 triggered_spell_id = 45429;
6188 triggered_spell_id = 45480;
6194 triggered_spell_id = 45428;
6211 triggered_spell_id = 45432;
6218 triggered_spell_id = 45431;
6235 triggered_spell_id = 45478;
6241 triggered_spell_id = 45430;
6262 triggered_spell_id = 52724;
6263 basepoints0 = damage / 2;
6282 triggered_spell_id = 63321;
6292 std::vector<uint32> RandomSpells;
6298 RandomSpells.push_back(71484);
6299 RandomSpells.push_back(71491);
6300 RandomSpells.push_back(71492);
6304 RandomSpells.push_back(71486);
6305 RandomSpells.push_back(71485);
6306 RandomSpells.push_back(71492);
6309 RandomSpells.push_back(71484);
6310 RandomSpells.push_back(71485);
6311 RandomSpells.push_back(71492);
6314 RandomSpells.push_back(71486);
6315 RandomSpells.push_back(71491);
6316 RandomSpells.push_back(71485);
6321 if (RandomSpells.empty())
6324 uint8 rand_spell =
irand(0, (RandomSpells.size() - 1));
6325 CastSpell(target, RandomSpells[rand_spell],
true, castItem, triggeredByAura, originalCaster);
6335 std::vector<uint32> RandomSpells;
6341 RandomSpells.push_back(71561);
6342 RandomSpells.push_back(71559);
6343 RandomSpells.push_back(71560);
6347 RandomSpells.push_back(71558);
6348 RandomSpells.push_back(71556);
6349 RandomSpells.push_back(71560);
6352 RandomSpells.push_back(71561);
6353 RandomSpells.push_back(71556);
6354 RandomSpells.push_back(71560);
6357 RandomSpells.push_back(71558);
6358 RandomSpells.push_back(71559);
6359 RandomSpells.push_back(71556);
6364 if (RandomSpells.empty())
6367 uint8 rand_spell =
irand(0, (RandomSpells.size() - 1));
6368 CastSpell(target, RandomSpells[rand_spell],
true, castItem, triggeredByAura, originalCaster);
6393 if (!victim || !
HasInArc(M_PI, victim))
6396 triggered_spell_id = 65934;
6408 int32 dmg = 5.5f * damage;
6413 if (caster->GetVictim())
6416 target->
CastCustomSpell(caster->GetVictim(), 69189, &dmg, 0, 0,
true);
6431 int32 dmg = 5.5f * damage;
6436 if (caster->GetVictim())
6439 target->
CastCustomSpell(caster->GetVictim(), 69189, &dmg, 0, 0,
true);
6450 int32 dmg = 3 * damage;
6451 caster->CastCustomSpell(caster, 70677, &dmg, 0, 0,
true);
6471 triggered_spell_id = 66765;
6488 triggered_spell_id = 29442;
6508 CastSpell(
this, 48108,
true, castItem, triggeredByAura);
6520 triggered_spell_id = 37436;
6523 switch (dummySpell->
Id)
6551 for (SpellCooldowns::const_iterator itr = cooldowns.begin(); itr != cooldowns.end(); ++itr)
6566 switch (dummySpell->
Id)
6586 switch (dummySpell->
Id)
6589 triggered_spell_id = 29842;
6592 triggered_spell_id = 29841;
6595 triggered_spell_id = 42771;
6598 LOG_ERROR(
"entities.unit",
"Unit::HandleDummyAuraProc: non handled spell id: %u (SW)", dummySpell->
Id);
6629 caster->CastSpell(
this, spell,
true, castItem);
6655 caster->CastSpell(
this, 32865,
true, castItem);
6663 switch (dummySpell->
Id)
6672 triggered_spell_id = 17941;
6682 for (Unit::AuraEffectList::const_iterator i = SoulLeechAuras.begin(); i != SoulLeechAuras.end(); ++i)
6684 if ((*i)->GetId() == 54117 || (*i)->GetId() == 54118)
6686 if ((*i)->GetEffIndex() != 0)
6688 basepoints0 =
int32((*i)->GetAmount());
6693 CastCustomSpell(target, 54607, &basepoints0,
nullptr,
nullptr,
true, castItem, triggeredByAura);
6696 CastCustomSpell(
this, 59117, &basepoints0,
nullptr,
nullptr,
true, castItem, triggeredByAura);
6703 CastSpell(
this, 57669,
true, castItem, triggeredByAura);
6712 triggered_spell_id = 30294;
6718 triggered_spell_id = 37379;
6730 triggered_spell_id = 37382;
6736 triggered_spell_id = 37378;
6748 if (procSpell->
Id != 552 || victim !=
this || !
roll_chance_i(triggerAmount))
6750 triggered_spell_id = 64136;
6754 switch (dummySpell->
Id)
6764 int32 team = total / 5;
6765 int32 self = total - team;
6766 CastCustomSpell(
this, 15290, &team, &
self,
nullptr,
true, castItem, triggeredByAura);
6774 triggered_spell_id = 40441;
6777 triggered_spell_id = 40440;
6804 triggered_spell_id = 56131;
6813 triggered_spell_id = 26170;
6825 triggered_spell_id = 39373;
6831 triggered_spell_id = 28810;
6839 triggered_spell_id = 70772;
6841 if (!blessHealing || !victim)
6853 switch (dummySpell->
Id)
6863 triggered_spell_id = 54833;
6870 triggered_spell_id = 54846;
6883 uint32 CountMin = AurEff->GetBase()->GetMaxDuration();
6886 uint32 CountMax = AurEff->GetSpellInfo()->GetMaxDuration();
6895 if (CountMin < CountMax)
6897 AurEff->GetBase()->SetDuration(AurEff->GetBase()->GetDuration() + triggerAmount *
IN_MILLISECONDS);
6898 AurEff->GetBase()->SetMaxDuration(CountMin + triggerAmount *
IN_MILLISECONDS);
6912 triggered_spell_id = 54820;
6921 if (triggerAmount <= 0)
6925 triggered_spell_id = 34299;
6932 CastCustomSpell(
this, 68285, &basepoints1, 0, 0,
true, 0, triggeredByAura);
6941 triggered_spell_id = 28742;
6950 triggered_spell_id = 54755;
6957 triggered_spell_id = 28848;
6965 triggered_spell_id = 37238;
6976 triggered_spell_id = 40445;
6982 triggered_spell_id = 40446;
6988 triggered_spell_id = 40452;
7004 triggered_spell_id = 32747;
7011 if (!victim || !procSpell || procSpell->
SpellIconID != 64)
7017 if (!caster->
GetGroup() && victim ==
this)
7027 if (!procSpell || effIndex != 0)
7036 if (target->
HasAura(isWrathSpell ? 48517 : 48518))
7039 triggered_spell_id = isWrathSpell ? 48518 : 48517;
7046 switch(dummySpell->
Id)
7053 if (
Aura* aur = aurEff->GetBase())
7054 if (!aur->IsRemoved() && aur->GetDuration() > 0)
7055 if ((aur->GetApplyTime() + aur->GetMaxDuration() / 1000 + 5) > (time(
nullptr) + aur->GetDuration() / 1000) )
7057 aur->SetDuration(aur->GetDuration() + 2000);
7069 triggered_spell_id = 32747;
7076 triggered_spell_id = 31665;
7077 basepoints0 = triggerAmount;
7087 aur->GetBase()->SetDuration(aur->GetSpellInfo()->GetMaxDuration(),
true);
7095 triggered_spell_id = 3409;
7106 if (basepoints0 <= 0)
7110 triggered_spell_id = 31663;
7136 basepoints0 = pEff->GetSpellInfo()->CalcPowerCost(
this,
SpellSchoolMask(pEff->GetSpellInfo()->SchoolMask)) * 4 / 10 / 3;
7144 if (basepoints0 <= 0)
7148 triggered_spell_id = 34720;
7153 triggered_spell_id = 57669;
7165 switch (dummySpell->
Id)
7168 triggered_spell_id = 56654;
7171 triggered_spell_id = 58882;
7178 switch (dummySpell->
Id)
7194 if (dummySpell->
Id == 53651)
7200 if (!beaconTarget || beaconTarget ==
this || !beaconTarget->
GetAura(53563, victim->
GetGUID()))
7203 basepoints0 =
int32(damage);
7204 triggered_spell_id = procSpell->
IsRankOf(
sSpellMgr->GetSpellInfo(635)) ? 53652 : 53654;
7206 victim->
CastCustomSpell(beaconTarget, triggered_spell_id, &basepoints0,
nullptr,
nullptr,
true, 0, triggeredByAura, victim->
GetGUID());
7213 triggered_spell_id = 31930;
7215 CastSpell(
this, 57669,
true, castItem, triggeredByAura);
7225 basepoints0 = triggerAmount * damage / 400;
7226 triggered_spell_id = 61840;
7235 basepoints0 = triggerAmount * damage / 400;
7236 triggered_spell_id = 54203;
7239 switch (dummySpell->
Id)
7248 victim->
CastCustomSpell(victim, 20267, &basepoints0, 0, 0,
true, 0, triggeredByAura);
7260 victim->
CastCustomSpell(victim, 20268, &basepoints0,
nullptr,
nullptr,
true, 0, triggeredByAura);
7277 triggered_spell_id = 28795;
7281 triggered_spell_id = 28793;
7285 triggered_spell_id = 28791;
7288 triggered_spell_id = 28790;
7298 if (effIndex != 0 || !victim)
7302 bool stacker = !procSpell || procSpell->
Id == 53595;
7306 if (!stacker && !damager)
7309 triggered_spell_id = 31803;
7314 if (aur->GetStackAmount() == 5)
7317 aur->RefreshDuration();
7319 CastSpell(victim, 42463,
true, castItem, triggeredByAura);
7331 if (effIndex != 0 || !victim)
7335 bool stacker = !procSpell || procSpell->
Id == 53595;
7339 if (!stacker && !damager)
7342 triggered_spell_id = 53742;
7347 if (aur->GetStackAmount() == 5)
7350 aur->RefreshDuration();
7352 CastSpell(victim, 53739,
true, castItem, triggeredByAura);
7378 triggered_spell_id = 31786;
7387 float chance = 0.0f;
7392 triggered_spell_id = 40471;
7398 triggered_spell_id = 40472;
7412 triggered_spell_id = 54968;
7419 triggered_spell_id = 64891;
7420 basepoints0 = triggerAmount * damage / 300;
7426 if (!victim || !victim->
IsAlive())
7429 CastSpell(
this, 71432,
true,
nullptr, triggeredByAura);
7436 triggered_spell_id = 71433;
7440 triggered_spell_id = 71434;
7450 triggered_spell_id = 71881;
7453 triggered_spell_id = 71883;
7456 triggered_spell_id = 71882;
7459 triggered_spell_id = 71884;
7472 triggered_spell_id = 71888;
7475 triggered_spell_id = 71886;
7478 triggered_spell_id = 71887;
7481 triggered_spell_id = 71885;
7493 switch (dummySpell->
Id)
7516 triggered_spell_id = 28824;
7520 triggered_spell_id = 28825;
7524 triggered_spell_id = 28826;
7527 triggered_spell_id = 28827;
7538 triggered_spell_id = 28850;
7545 if (!player || !castItem || !castItem->
IsEquipped() || !victim || !victim->
IsAlive())
7588 LOG_ERROR(
"entities.unit",
"Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)",
7595 if (!windfurySpellInfo)
7597 LOG_ERROR(
"entities.unit",
"Unit::HandleDummyAuraProc: non-existing spell id: %u (Windfury)", spellId);
7607 triggered_spell_id = 25504;
7610 triggered_spell_id = 33750;
7620 for (
uint32 i = 0; i < 2; ++i)
7621 CastCustomSpell(victim, triggered_spell_id, &basepoints0,
nullptr,
nullptr,
true, castItem, triggeredByAura);
7634 triggered_spell_id = 40465;
7639 triggered_spell_id = 40465;
7644 triggered_spell_id = 40466;
7664 triggered_spell_id = 55533;
7675 triggered_spell_id = 58879;
7677 CastCustomSpell(
this, triggered_spell_id, &basepoints0,
nullptr,
nullptr,
true, castItem, triggeredByAura, originalCaster);
7684 triggered_spell_id = 64930;
7693 triggered_spell_id = 71824;
7695 if (!triggeredSpell)
7709 Aura* flameShock = aurEff->GetBase();
7711 int32 newDuration = flameShock->
GetDuration() + 2 * aurEff->GetAmplitude();
7715 if (newDuration > maxDuration)
7732 float chance = (float)triggerAmount;
7736 triggered_spell_id = 63685;
7742 triggered_spell_id = 52759;
7773 basepoints0 =
int32((fire_onhit * BaseWeaponSpeed) + (add_spellpower * BaseWeaponSpeed));
7774 triggered_spell_id = 10444;
7783 basepoints0 =
int32((fire_onhit * BaseWeaponSpeed) + (add_spellpower * BaseWeaponSpeed));
7784 triggered_spell_id = 10444;
7791 CastCustomSpell(victim, triggered_spell_id, &basepoints0,
nullptr,
nullptr,
true, castItem, triggeredByAura);
7801 float chance = (float)triggeredByAura->
GetAmount();
7816 uint32 spell = aurEff->GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
7817 CastSpell(
this, spell,
true, castItem, triggeredByAura);
7851 CastCustomSpell(victim, spell, &dmg, 0, 0,
true, castItem, triggeredByAura);
7861 uint32 spell =
sSpellMgr->GetSpellWithRank(26364, aurEff->GetSpellInfo()->GetRank());
7862 CastSpell(target, spell,
true, castItem, triggeredByAura);
7863 aurEff->GetBase()->DropCharge();
7883 basepoints0 = triggerAmount;
7884 triggered_spell_id = 50163;
7889 if (dummySpell->
Id == 49005)
7892 triggered_spell_id = 61607;
7896 if (dummySpell->
Id == 49194)
7898 triggered_spell_id = 50536;
7900 if (!unholyBlight || !victim)
7907 AddPct(basepoints0, glyph->GetAmount());
7917 triggered_spell_id = 50181;
7925 triggered_spell_id = 51460;
7938 switch (procSpell->
Id)
7942 triggered_spell_id = 66198;
7945 triggered_spell_id = 66972;
7948 triggered_spell_id = 66973;
7951 triggered_spell_id = 66974;
7956 triggered_spell_id = 66196;
7959 triggered_spell_id = 66958;
7962 triggered_spell_id = 66959;
7965 triggered_spell_id = 66960;
7968 triggered_spell_id = 66961;
7971 triggered_spell_id = 66962;
7976 triggered_spell_id = 66216;
7979 triggered_spell_id = 66988;
7982 triggered_spell_id = 66989;
7985 triggered_spell_id = 66990;
7988 triggered_spell_id = 66991;
7991 triggered_spell_id = 66992;
7996 triggered_spell_id = 66188;
7999 triggered_spell_id = 66950;
8002 triggered_spell_id = 66951;
8005 triggered_spell_id = 66952;
8008 triggered_spell_id = 66953;
8013 triggered_spell_id = 66217;
8018 triggered_spell_id = 66215;
8021 triggered_spell_id = 66975;
8024 triggered_spell_id = 66976;
8027 triggered_spell_id = 66977;
8030 triggered_spell_id = 66978;
8033 triggered_spell_id = 66979;
8051 CastCustomSpell(target, triggered_spell_id, &basepoints0,
nullptr,
nullptr,
true, castItem, triggeredByAura, originalCaster);
8053 CastSpell(target, triggered_spell_id,
true, castItem, triggeredByAura, originalCaster);
8058 if (dummySpell->
Id == 61257)
8066 triggered_spell_id = 61258;
8076 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
8092 if (!chain || !newChain || (chain->
rank < newChain->
rank))
8094 triggered_spell_id = itr->first;
8101 if (chain && chain->
last->
Id == itr->first)
8111 if (dummySpell->
Id == 17619)
8119 triggered_spell_id = 21399;
8123 triggered_spell_id = 21400;
8129 CastCustomSpell(
this, triggered_spell_id, &basepoints0,
nullptr,
nullptr,
true,
nullptr, triggeredByAura);
8146 triggered_spell_id = 54445;
8148 float addThreat = float(
CalculatePct(procSpell->
Effects[0].CalcValue(
this), triggerAmount));
8154 triggered_spell_id = dummySpell->
Id == 62765 ? 62801 : 62800;
8165 if (!triggered_spell_id)
8166 triggered_spell_id = dummySpell->
Effects[triggeredByAura->
GetEffIndex()].TriggerSpell;
8169 if (!triggered_spell_id)
8175 LOG_ERROR(
"entities.unit",
"Unit::HandleDummyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->
Id, triggered_spell_id);
8179 if (cooldown_spell_id == 0)
8180 cooldown_spell_id = triggered_spell_id;
8191 CastCustomSpell(target, triggered_spell_id, &basepoints0,
nullptr,
nullptr,
true, castItem, triggeredByAura, originalCaster);
8193 CastSpell(target, triggered_spell_id,
true, castItem, triggeredByAura, originalCaster);
8207 switch (dummySpell->
Id)
8227 for (
uint8 i = 1; i <= stack; ++i)
8262 switch (dummySpell->
Id)
8268 if (!caster || !damage)
8334 if (player->GetCurrentRune(i) ==
RUNE_DEATH ||
8340 if (player->GetCurrentRune(i) ==
RUNE_DEATH ||
8344 if (player->GetRuneCooldown(i) != player->GetRuneBaseCooldown(i,
false))
8349 player->AddRuneByAuraEffect(i,
RUNE_DEATH, aurEff);
8359 switch (dummySpell->
Id)
8388 Unit* target =
nullptr;
8389 int32 basepoints0 = 0;
8392 basepoints0 = triggerAmount;
8403 switch (auraSpellInfo->
Id)
8453 CastSpell(
this, 29471,
true, castItem, triggeredByAura);
8454 if (victim && victim->
IsAlive())
8455 CastSpell(victim, 27526,
true, castItem, triggeredByAura);
8461 int32 dmg = damage * 0.45f;
8464 if (
Unit* c = a->GetCaster())
8475 cr->CastSpell(victim, 50101,
true);
8484 switch (auraSpellInfo->
Id)
8488 trigger_spell_id = 31643;
8491 LOG_ERROR(
"entities.unit",
"Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed", auraSpellInfo->
Id);
8508 trigger_spell_id = 54370;
8511 trigger_spell_id = 54371;
8514 trigger_spell_id = 54375;
8517 trigger_spell_id = 54372;
8520 trigger_spell_id = 54374;
8523 trigger_spell_id = 54373;
8536 switch (auraSpellInfo->
Id)
8539 trigger_spell_id = 27813;
8542 trigger_spell_id = 27817;
8545 trigger_spell_id = 27818;
8548 LOG_ERROR(
"entities.unit",
"Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->
Id);
8561 switch (auraSpellInfo->
Id)
8569 trigger_spell_id = 37344;
8572 trigger_spell_id = 37341;
8576 trigger_spell_id = 37340;
8579 trigger_spell_id = 37342;
8582 trigger_spell_id = 37343;
8595 trigger_spell_id = 67355;
8599 trigger_spell_id = 67354;
8618 switch (auraSpellInfo->
Id)
8623 trigger_spell_id = 63468;
8626 LOG_ERROR(
"entities.unit",
"Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots", auraSpellInfo->
Id);
8638 else if (auraSpellInfo->
Id == 67151)
8644 trigger_spell_id = 68130;
8651 switch (auraSpellInfo->
Id)
8659 trigger_spell_id = 60512;
8662 trigger_spell_id = 60513;
8665 trigger_spell_id = 60514;
8668 trigger_spell_id = 60515;
8683 uint32 stack_spell_id = 0;
8684 switch (auraSpellInfo->
Id)
8687 stack_spell_id = 37658;
8688 trigger_spell_id = 37661;
8691 stack_spell_id = 54842;
8692 trigger_spell_id = 54843;
8695 stack_spell_id = 67713;
8696 trigger_spell_id = 67714;
8699 stack_spell_id = 67759;
8700 trigger_spell_id = 67760;
8712 CastSpell(
this, stack_spell_id,
true,
nullptr, triggeredByAura);
8719 CastSpell(victim, trigger_spell_id,
true,
nullptr, triggeredByAura);
8729 uint32 originalSpellId = procSpell->
Id;
8733 switch (procSpell->
Id)
8736 originalSpellId = 20473;
8739 originalSpellId = 20929;
8742 originalSpellId = 20930;
8745 originalSpellId = 27174;
8748 originalSpellId = 33072;
8751 originalSpellId = 48824;
8754 originalSpellId = 48825;
8757 LOG_ERROR(
"entities.unit",
"Unit::HandleProcTriggerSpell: Spell %u not handled in HShock", procSpell->
Id);
8764 LOG_ERROR(
"entities.unit",
"Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu", originalSpellId);
8770 trigger_spell_id = 20272;
8782 trigger_spell_id =
sSpellMgr->GetSpellWithRank(26364, auraSpellInfo->
GetRank());
8791 if (victim && victim->
IsAlive())
8795 trigger_spell_id = 31616;
8812 trigger_spell_id = 50490;
8815 trigger_spell_id = 50362;
8818 trigger_spell_id = 50488;
8821 trigger_spell_id = 50485;
8824 trigger_spell_id = 50489;
8827 trigger_spell_id = 50486;
8834 else if (auraSpellInfo->
Id == 63611)
8839 trigger_spell_id = 50475;
8849 if (triggerEntry ==
nullptr)
8852 LOG_ERROR(
"entities.unit",
"Unit::HandleProcTriggerSpell: Spell %u (effIndex: %u) has unknown TriggerSpell %u. Unhandled custom case?", auraSpellInfo->
Id, triggeredByAura->
GetEffIndex(), trigger_spell_id);
8862 switch (auraSpellInfo->
Id)
8884 trigger_spell_id = 26470;
8890 if (!victim || victim->
GetEntry() != 19457)
8918 trigger_spell_id = 22588;
8966 victim->
CastSpell(victim, trigger_spell_id,
true);
8987 if (auraSpellInfo->
Id == 70656)
8993 if (
ToPlayer()->GetRuneCooldown(i) == 0)
9025 if ((aurEff->GetBase()->GetMaxDuration() - aurEff->GetBase()->GetDuration()) < 1000)
9028 CastSpell(victim, trigger_spell_id,
true);
9035 switch (trigger_spell_id)
9053 if (pTarget->HasSpellCooldown(trigger_spell_id) )
9058 Unit* cptarget =
nullptr;
9059 if (trigger_spell_id == 51699)
9063 cptarget = pTarget->GetSelectedUnit();
9070 target->
CastSpell(cptarget, trigger_spell_id,
true);
9105 if (!victim || victim ==
this)
9145 CastCustomSpell(
this, trigger_spell_id, &basepoints0, &basepoints0,
nullptr,
true, castItem, triggeredByAura);
9160 if (
GetAura((trigger_spell_id == 46916) ? 71072 : 71069))
9172 CastSpell(
this, 70849,
true, castItem, triggeredByAura);
9173 if (trigger_spell_id == 46916)
9174 CastSpell(
this, 71072,
true, castItem, triggeredByAura);
9176 CastSpell(
this, 71069,
true, castItem, triggeredByAura);
9202 if ((maelstrom->GetStackAmount() == 4) &&
roll_chance_i(aurEff->GetAmount()))
9203 CastSpell(
this, 70831,
true, castItem, triggeredByAura);
9271 uint8 chance =
uint8(ceil(fofRank * fbRank * 16.6f));
9274 CastSpell(victim, aurEff->GetSpellInfo()->Effects[
EFFECT_0].TriggerSpell,
true);
9281 if (target ==
nullptr)
9293 CastCustomSpell(target, triggerEntry->
Id, &basepoints0,
nullptr,
nullptr,
true, castItem, triggeredByAura);
9295 CastSpell(target, triggerEntry->
Id,
true, castItem, triggeredByAura);
9304 if (!victim || !victim->
IsAlive())
9310 uint32 triggered_spell_id = 0;
9316 if (!procSpell || procSpell->
SpellVisual[0] != 9487)
9318 triggered_spell_id = 12484;
9323 if (!procSpell || procSpell->
SpellVisual[0] != 9487)
9325 triggered_spell_id = 12485;
9330 if (!procSpell || procSpell->
SpellVisual[0] != 9487)
9332 triggered_spell_id = 12486;
9344 triggered_spell_id = 28722;
9347 triggered_spell_id = 28723;
9350 triggered_spell_id = 28724;
9358 triggered_spell_id = 28750;
9361 triggered_spell_id = 37445;
9372 triggered_spell_id = 48542;
9375 triggered_spell_id = 48541;
9378 triggered_spell_id = 48540;
9381 triggered_spell_id = 48543;
9393 if (!triggered_spell_id)
9401 LOG_ERROR(
"entities.unit",
"Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u", triggered_spell_id, scriptId);
9413 CastSpell(victim, triggered_spell_id,
true, castItem, triggeredByAura);
9429 if (pet->isControlled())
9437 float powerMultiplier = 1.0f;
9440 powerMultiplier = creature->GetCreatureTemplate()->ModMana;
9442 switch (new_powertype)
9465 if (player->NeedSendSpectatorData())
9483 LOG_ERROR(
"entities.unit",
"Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(),
GetFaction());
9485 LOG_ERROR(
"entities.unit",
"Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry,
GetFaction());
9517 if (selfPlayerOwner)
9523 else if (targetPlayerOwner)
9534 if (selfPlayerOwner && targetPlayerOwner)
9537 if (selfPlayerOwner == targetPlayerOwner)
9555 if (selfPlayerOwner)
9565 if (targetFactionEntry->CanHaveReputation())
9586 if (!
sScriptMgr->IfNormalReaction(
this, target, repRank))
9595 if (!factionTemplateEntry)
9599 if (!targetFactionTemplateEntry)
9613 if (
ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry))
9619 if (factionEntry->CanHaveReputation())
9622 ReputationRank repRank = targetPlayerOwner->GetReputationMgr().GetRank(factionEntry);
9623 if (targetPlayerOwner->GetReputationMgr().IsAtWar(factionEntry))
9632 if (factionTemplateEntry->
IsHostileTo(*targetFactionTemplateEntry))
9634 if (factionTemplateEntry->
IsFriendlyTo(*targetFactionTemplateEntry))
9636 if (targetFactionTemplateEntry->
IsFriendlyTo(*factionTemplateEntry))
9657 if (!my_faction || !my_faction->
faction)
9670 if (!my_faction || !my_faction->
faction)
9682 if (!victim || victim ==
this)
9822 creature->SetNoCallAssistance(
false);
9824 if (creature->HasSearchedAssistance())
9826 creature->SetNoSearchAssistance(
false);
9856 (*itr)->CombatStop(includingCast);
9866 if ((*itr)->isAttackingPlayer())
9872 if (summon->isAttackingPlayer())
9883 if (!(*iter)->AttackStop())
9885 LOG_ERROR(
"entities.unit",
"WORLD: Unit has an attacker that isn't attacking it!");
9899 for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end(); ++itr)
9901 if( (*itr).second->IsRemoved() )
9904 if( (*itr).second->GetSpellInfo()->CasterAuraState == flag )
9919 for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end(); ++itr)
9921 if( (*itr).second->GetSpellInfo()->CasterAuraState == flag )
9935 if (itr->second->GetBase()->GetCasterGUID() == target->
GetGUID())
9936 auraStates |= (1 << (itr->first - 1));
9948 for (AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j)
9949 if ((*j)->IsAffectedOnSpell(spellProto))
9957 for (AuraStateAurasMap::const_iterator itr = range.first; itr != range.second; ++itr)
9958 if (itr->second->GetBase()->GetCasterGUID() == Caster->
GetGUID())
10038 LOG_ERROR(
"entities.unit",
"Unit::GetFirstMinion: Minion %s not exist.", pet_guid.ToString().c_str());
10053 LOG_FATAL(
"entities.unit",
"Unit::GetGuardianPet: Guardian %s not exist.", pet_guid.ToString().c_str());
10067 LOG_ERROR(
"entities.unit",
"Unit::GetCharm: Charmed creature %s not exist.", charm_guid.ToString().c_str());
10101 if (oldPet != minion && (oldPet->IsPet() || minion->
IsPet() || oldPet->GetEntry() != minion->
GetEntry()))
10104 if (oldPet->IsPet())
10107 oldPet->UnSummon();
10205 if (
GetGUID() == (*itr)->GetCharmerGUID())
10209 if ((*itr)->GetOwnerGUID() !=
GetGUID())
10212 (*itr)->OutDebugInfo();
10225 if ((*itr)->IsPet())
10347 Unit* unit = healer;
10361 if (gain && player->InBattleground())
10385 for (Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
10403 for (Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
10405 if (
Unit* magnet = (*itr)->GetBase()->GetUnitOwner())
10412 magnet->m_Events.AddEvent(
new RedirectSpellEvent(*magnet, victim->
GetGUID(), *itr), magnet->m_Events.CalculateQueueTime(100));
10414 if (magnet->IsTotem())
10416 uint64 queueTime = magnet->m_Events.CalculateQueueTime(100);
10417 if (spellInfo->
Speed > 0.0f)
10419 float dist =
GetDistance(magnet->GetPositionX(), magnet->GetPositionY(), magnet->GetPositionZ());
10422 queueTime = magnet->m_Events.CalculateTime((
uint64)floor(dist / spellInfo->
Speed * 1000.0f));
10437 for (AuraEffectList::const_iterator i = hitTriggerAuras.begin(); i != hitTriggerAuras.end(); ++i)
10439 if (
Unit* magnet = (*i)->GetBase()->GetCaster())
10486 LOG_ERROR(
"entities.unit",
"Unit %u is trying to release unit %u which is neither charmed nor owned by it",
GetEntry(), target->
GetEntry());
10493 Player* player =
nullptr;
10507 if (player !=
this)
10517 std::vector<Unit*> nearMembers;
10522 if (
Player* Target = itr->GetSource())
10528 if (Target !=
this && Target->IsAlive() && !
IsHostileTo(Target))
10529 nearMembers.push_back(Target);
10534 nearMembers.push_back(pet);
10537 if (nearMembers.empty())
10540 uint32 randTarget =
urand(0, nearMembers.size() - 1);
10541 return nearMembers[randTarget];
10593 if (OldTotem->IsSummon())
10595 if (!(onDeath && !
IsPlayer() && OldTotem->IsGuardian()))
10597 OldTotem->ToTempSummon()->UnSummon();
10610 data <<
uint32(SpellID);
10612 data <<
uint32(OverHeal);
10614 data <<
uint8(critical ? 1 : 0);
10638 data <<
uint32(spellID);
10639 data <<
uint32(powerType);
10672 return owner->SpellPctDamageModsDone(victim, spellProto, damagetype);
10678 return owner->SpellPctDamageModsDone(victim, spellProto, damagetype);
10683 float DoneTotalMod = 1.0f;
10686 for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
10689 if (spellProto->
EquippedItemClass == -1 && (*i)->GetSpellInfo()->EquippedItemClass != -1 &&
10698 if (!
sScriptMgr->IsNeedModSpellDamagePercent(
this, *i, DoneTotalMod, spellProto))
10703 if ((*i)->GetSpellInfo()->EquippedItemClass == -1)
10704 AddPct(DoneTotalMod, (*i)->GetAmount());
10706 AddPct(DoneTotalMod, (*i)->GetAmount());
10707 else if (
ToPlayer() &&
ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo()))
10708 AddPct(DoneTotalMod, (*i)->GetAmount());
10714 for (AuraEffectList::const_iterator i = mDamageDoneVersus.begin(); i != mDamageDoneVersus.end(); ++i)
10716 AddPct(DoneTotalMod, (*i)->GetAmount());
10720 for (AuraEffectList::const_iterator i = mDamageDoneVersusAurastate.begin(); i != mDamageDoneVersusAurastate.end(); ++i)
10722 AddPct(DoneTotalMod, (*i)->GetAmount());
10727 for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
10734 switch ((*i)->GetMiscValue())
10739 AddPct(DoneTotalMod, (*i)->GetAmount());
10743 if (!(*i)->IsAffectedOnSpell(spellProto))
10746 switch ((*i)->GetMiscValue())
10753 AddPct(DoneTotalMod, (*i)->GetAmount());
10761 int32 maxPercent = (*i)->GetAmount();
10765 int32 modPercent = 0;
10767 for (AuraApplicationMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
10769 Aura const* aura = itr->second->GetBase();
10774 if (modPercent >= maxPercent)
10776 modPercent = maxPercent;
10780 AddPct(DoneTotalMod, modPercent);
10787 AddPct(DoneTotalMod, (*i)->GetAmount());
10792 AddPct(DoneTotalMod, (*i)->GetAmount());
10800 if ((*i)->GetSpellInfo()->SpellIconID == 2656)
10804 AddPct(DoneTotalMod, (*i)->GetAmount());
10811 AddPct(DoneTotalMod, (*i)->GetAmount());
10820 AddPct(DoneTotalMod, (*i)->GetSpellInfo()->GetRank() * 2.0f);
10827 AddPct(DoneTotalMod, (*i)->GetAmount());
10838 AddPct(DoneTotalMod, (*i)->GetAmount());
10850 int32 bonus = -(*i)->GetBase()->GetEffect(0)->GetAmount();
10851 AddPct(DoneTotalMod, bonus);
10869 DoneTotalMod *= 4.0f;
10871 DoneTotalMod *= 3.0f;
10879 AddPct(DoneTotalMod, aurEff->GetAmount());
10889 AddPct(DoneTotalMod, aurEff->GetAmount());
10895 AddPct(DoneTotalMod, aurEff->GetAmount());
10903 AddPct(DoneTotalMod, aurEff->GetAmount());
10911 AddPct(DoneTotalMod, aurEff->GetAmount());
10922 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
10923 if (((*itr)->GetId() == 31803 || (*itr)->GetId() == 53742) && (*itr)->GetCasterGUID() ==
GetGUID())
10925 stacks = (*itr)->GetBase()->GetStackAmount();
10930 AddPct(DoneTotalMod, 10 * stacks);
10939 AddPct(DoneTotalMod, aurEff->GetAmount());
10948 for (AuraEffectList::const_iterator i = mDumyAuras.begin(); i != mDumyAuras.end(); ++i)
10949 if ((*i)->GetSpellInfo()->SpellIconID == 3173)
10951 AddPct(DoneTotalMod, (*i)->GetAmount());
10962 AddPct(DoneTotalMod, 15 * count);
10969 AddPct(DoneTotalMod, aurEff->GetAmount());
10975 AddPct(DoneTotalMod, aurEff->GetAmount());
10981 AddPct(DoneTotalMod, aurEff->GetAmount());
10985 return DoneTotalMod;
11003 return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype, TotalMod, stack);
11009 return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype, TotalMod, stack) / 2;
11014 float ApCoeffMod = 1.0f;
11015 int32 DoneTotal = 0;
11033 for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
11035 if (!(*i)->IsAffectedOnSpell(spellProto))
11038 switch ((*i)->GetMiscValue())
11049 DoneTotal += (*i)->GetAmount();
11061 AddPct(DoneTotal, aurEff->GetAmount());
11065 AddPct(ApCoeffMod, aurEff->GetAmount());
11072 ApCoeffMod = 1.5835f;
11084 if (damagetype ==
DOT)
11103 DoneTotal +=
int32(bonus->
ap_bonus * stack * ApCoeffMod * APbonus);
11109 if (coeff && DoneAdvertisedBenefit)
11120 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * factorMod);
11123 float tmpDamage = (float(pdamage) + DoneTotal) * DoneTotalMod;
11128 return uint32(std::max(tmpDamage, 0.0f));
11136 int32 TakenTotal = 0;
11137 float TakenTotalMod = 1.0f;
11142 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
11145 AddPct(TakenTotalMod, (*i)->GetAmount());
11153 for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i)
11154 if ((*i)->GetCasterGUID() == caster->
GetGUID() && (*i)->IsAffectedOnSpell(spellProto))
11156 AddPct(TakenTotalMod, (*i)->GetAmount());
11161 int32 modifierMax = 0;
11162 int32 modifierMin = 0;
11164 for (AuraEffectList::const_iterator i = auraEffectList.begin(); i != auraEffectList.end(); ++i)
11171 if (!caster || caster->
GetGUID() != (*i)->GetCasterGUID())
11174 if (mechanicMask &
uint32(1 << (*i)->GetMiscValue()))
11176 if ((*i)->GetAmount() > 0)
11178 if ((*i)->GetAmount() > modifierMax)
11179 modifierMax = (*i)->GetAmount();
11181 else if ((*i)->GetAmount() < modifierMin)
11182 modifierMin = (*i)->GetAmount();
11186 AddPct(TakenTotalMod, modifierMax);
11187 AddPct(TakenTotalMod, modifierMin);
11199 if (TakenAdvertisedBenefit)
11210 TakenTotal +=
int32(TakenAdvertisedBenefit * coeff * factorMod);
11217 TakenTotalMod = 1.0f;
11223 float ignoreModifier = 1.0f - TakenTotalMod;
11224 bool addModifier =
false;
11226 for (AuraEffectList::const_iterator j = ResIgnoreAuras.begin(); j != ResIgnoreAuras.end(); ++j)
11227 if ((*j)->GetMiscValue() & spellProto->
SchoolMask)
11229 ApplyPct(ignoreModifier, (*j)->GetAmount());
11230 addModifier =
true;
11234 TakenTotalMod += ignoreModifier;
11237 float tmpDamage = (float(pdamage) + TakenTotal) * TakenTotalMod;
11239 return uint32(std::max(tmpDamage, 0.0f));
11249 for (
auto i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
11251 if (!(*i) || !(*i)->GetSpellInfo())
11256 if (
auto spellIconId = (*i)->GetSpellInfo()->SpellIconID)
11258 switch (spellIconId)
11268 AddPct(TakenTotalMod, std::max(mod,
float((*i)->GetAmount())));
11274 return TakenTotalMod;
11279 int32 DoneAdvertisedBenefit = 0;
11282 for (AuraEffectList::const_iterator i = mDamageDone.begin(); i != mDamageDone.end(); ++i)
11283 if (((*i)->GetMiscValue() & schoolMask) != 0 &&
11284 (*i)->GetSpellInfo()->EquippedItemClass == -1 &&
11286 (*i)->GetSpellInfo()->EquippedItemInventoryTypeMask == 0)
11288 DoneAdvertisedBenefit += (*i)->GetAmount();
11297 for (AuraEffectList::const_iterator i = mDamageDoneOfStatPercent.begin(); i != mDamageDoneOfStatPercent.end(); ++i)
11299 if ((*i)->GetMiscValue() & schoolMask)
11302 Stats usedStat =
Stats((*i)->GetMiscValueB());
11308 for (AuraEffectList::const_iterator i = mDamageDonebyAP.begin(); i != mDamageDonebyAP.end(); ++i)
11309 if ((*i)->GetMiscValue() & schoolMask)
11312 return DoneAdvertisedBenefit;
11317 int32 TakenAdvertisedBenefit = 0;
11320 for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i)
11321 if (((*i)->GetMiscValue() & schoolMask) != 0)
11328 TakenAdvertisedBenefit += (*i)->GetAmount();
11331 return TakenAdvertisedBenefit;
11348 float crit_chance = 0.0f;
11354 crit_chance = 0.0f;
11370 switch (attackType)
11387 crit_chance = 5.0f;
11406 return crit_chance;
11419 float crit_chance = doneChance;
11440 for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
11442 if (!((*i)->IsAffectedOnSpell(spellProto)))
11444 int32 modChance = 0;
11445 switch ((*i)->GetMiscValue())
11458 crit_chance += modChance;
11462 crit_chance += (*i)->GetAmount();
11467 crit_chance += (*i)->GetAmount();
11481 crit_chance += aurEff->GetAmount();
11487 crit_chance += aurEff->GetAmount();
11497 crit_chance += aurEff->GetAmount();
11504 crit_chance = 0.0f;
11512 crit_chance += aura->GetAmount();
11548 crit_chance += rendAndTear->GetAmount();
11558 crit_chance += aurEff->GetAmount();
11603 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
11605 if (caster->
GetGUID() != (*i)->GetCasterGUID())
11608 crit_chance += (*i)->GetAmount();
11618 return crit_chance;
11624 int32 crit_bonus = damage;
11625 float crit_mod = 0.0f;
11632 crit_bonus += damage;
11635 crit_bonus += damage / 2;
11646 if (crit_bonus != 0 && crit_mod != 0.0f)
11647 AddPct(crit_bonus, crit_mod);
11649 crit_bonus -= damage;
11651 if (damage >
uint32(crit_bonus))
11658 crit_bonus += damage;
11673 crit_bonus = damage;
11676 crit_bonus = damage / 2;
11694 if (crit_bonus > 0)
11695 damage += crit_bonus;
11708 return owner->SpellPctHealingModsDone(victim, spellProto, damagetype);
11722 float DoneTotalMod = 1.0f;
11726 for (
auto const& auraEff : mHealingDonePct)
11728 if (!
sScriptMgr->IsNeedModHealPercent(
this, auraEff, DoneTotalMod, spellProto))
11731 AddPct(DoneTotalMod, auraEff->GetAmount());
11737 for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
11739 if (!(*i)->IsAffectedOnSpell(spellProto))
11742 switch ((*i)->GetMiscValue())
11748 AddPct(DoneTotalMod, (*i)->GetAmount());
11753 AddPct(DoneTotalMod, (*i)->GetAmount());
11761 AddPct(DoneTotalMod, (*i)->GetAmount());
11773 if (spellProto->
Id == 52042)
11777 AddPct(DoneTotalMod, dummy->GetAmount());
11781 AddPct(DoneTotalMod, aurEff->GetAmount());
11786 if (spellProto->
Id == 63544)
11788 AddPct(DoneTotalMod, aurEff->GetAmount());
11792 return DoneTotalMod;
11800 return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, TotalMod, stack);
11806 float ApCoeffMod = 1.0f;
11808 int32 DoneTotal = 0;
11813 for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
11815 if (!(*i)->IsAffectedOnSpell(spellProto))
11817 switch ((*i)->GetMiscValue())
11822 DoneTotal += (*i)->GetAmount();
11836 AddPct(ApCoeffMod, aurEff->GetAmount());
11845 if (damagetype ==
DOT)
11868 if (DoneAdvertisedBenefit)
11877 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * factorMod);
11882 switch (spellProto->
Effects[i].ApplyAuraName)
11895 float heal = float(
int32(healamount) + DoneTotal) * DoneTotalMod;
11901 return uint32(std::max(heal, 0.0f));
11906 float TakenTotalMod = 1.0f;
11911 AddPct(TakenTotalMod, minval);
11915 AddPct(TakenTotalMod, maxval);
11919 AddPct(TakenTotalMod, Tenacity->GetAmount());
11922 int32 TakenTotal = 0;
11933 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
11935 if (((*i)->GetCasterGUID() == caster->
GetGUID()))
11937 SpellInfo const* spell = (*i)->GetSpellInfo();
11941 TakenTotalMod *= 1.2f;
11946 TakenTotalMod += 0.06f;
11951 if (damagetype ==
DOT)
11956 AddPct(TakenTotalMod, minval_hot);
11960 AddPct(TakenTotalMod, maxval_hot);
11966 float factorMod = 1.0f;
11974 healamount =
uint32(std::max((
float(healamount) * TakenTotalMod), 0.0f));
11980 if (TakenAdvertisedBenefit)
11982 float TakenCoeff = 0.0f;
11984 coeff = CalculateDefaultCoefficient(spellProto, damagetype) *
int32(stack) * 1.88f;
11986 factorMod *= CalculateLevelPenalty(spellProto) *
int32(stack);
11987 if (
Player* modOwner = GetSpellModOwner())
11994 TakenTotal +=
int32(TakenAdvertisedBenefit * (coeff > 0 ? coeff : TakenCoeff) * factorMod);
12000 for (AuraEffectList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i)
12001 if (caster->GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectedOnSpell(spellProto))
12002 AddPct(TakenTotalMod, (*i)->GetAmount());
12007 switch (spellProto->Effects[i].ApplyAuraName)
12023 TakenTotalMod = 1.0f;
12026 float heal = float(
int32(healamount) + TakenTotal) * TakenTotalMod;
12028 return uint32(std::max(heal, 0.0f));
12033 int32 AdvertisedBenefit = 0;
12036 for (AuraEffectList::const_iterator i = mHealingDone.begin(); i != mHealingDone.end(); ++i)
12037 if (!(*i)->GetMiscValue() || ((*i)->GetMiscValue() & schoolMask) != 0)
12038 AdvertisedBenefit += (*i)->GetAmount();
12048 for (AuraEffectList::const_iterator i = mHealingDoneOfStatPercent.begin(); i != mHealingDoneOfStatPercent.end(); ++i)
12051 Stats usedStat =
Stats((*i)->GetSpellInfo()->Effects[(*i)->GetEffIndex()].MiscValue);
12057 for (AuraEffectList::const_iterator i = mHealingDonebyAP.begin(); i != mHealingDonebyAP.end(); ++i)
12058 if ((*i)->GetMiscValue() & schoolMask)
12061 return AdvertisedBenefit;
12066 int32 AdvertisedBenefit = 0;
12069 for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i)
12070 if (((*i)->GetMiscValue() & schoolMask) != 0)
12071 AdvertisedBenefit += (*i)->GetAmount();
12073 return AdvertisedBenefit;
12080 for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
12081 if((itr->type & meleeSchoolMask) == meleeSchoolMask)
12107 for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
12108 if((itr->type & schoolMask) == schoolMask)
12118 for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
12119 if((itr->type & meleeSchoolMask) == meleeSchoolMask)
12131 if (spellInfo->
Id != 42292 && spellInfo->
Id != 59752 && spellInfo->
Id != 19574 && spellInfo->
Id != 34471)
12135 for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
12160 for (SpellImmuneList::const_iterator itr = idList.begin(); itr != idList.end(); ++itr)
12161 if (itr->type == spellInfo->
Id)
12166 if (!allowIdList.empty())
12168 for (SpellImmuneList::const_iterator itr = allowIdList.begin(); itr != allowIdList.end(); ++itr)
12169 if (itr->type == spellInfo->
Id)
12180 for (SpellImmuneList::const_iterator itr = dispelList.begin(); itr != dispelList.end(); ++itr)
12181 if (itr->type == spellInfo->
Dispel)
12189 for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
12190 if (itr->type == spellInfo->
Mechanic)
12194 bool immuneToAllEffects =
true;
12199 if (!spellInfo->
Effects[i].IsEffect())
12210 immuneToAllEffects =
false;
12213 if (immuneToAllEffects)
12216 if (spellInfo->
Id != 42292 && spellInfo->
Id != 59752 && spellInfo->
Id != 19574 && spellInfo->
Id != 34471)
12219 for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
12234 if (!spellInfo || !spellInfo->
Effects[index].IsEffect())
12247 for (SpellImmuneList::const_iterator itr = effectList.begin(); itr != effectList.end(); ++itr)
12248 if (itr->type == effect && (itr->spellId != 62692 || spellInfo->
Effects[index].MiscValue ==
POWER_MANA))
12254 for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
12255 if (itr->type == mechanic)
12262 for (SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
12263 if (itr->type == aura && (itr->spellId != 64848 || spellInfo->
Effects[index].MiscValue ==
POWER_MANA))
12272 for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter)
12290 if (!victim || pdamage == 0)
12299 return owner->MeleeDamageBonusDone(victim, pdamage, attType, spellProto) / 2;
12306 int32 DoneFlatBenefit = 0;
12310 for (AuraEffectList::const_iterator i = mDamageDoneCreature.begin(); i != mDamageDoneCreature.end(); ++i)
12311 if (creatureTypeMask &
uint32((*i)->GetMiscValue()))
12312 DoneFlatBenefit += (*i)->GetAmount();
12326 for (AuraEffectList::const_iterator i = mCreatureAttackPower.begin(); i != mCreatureAttackPower.end(); ++i)
12327 if (creatureTypeMask &
uint32((*i)->GetMiscValue()))
12328 APbonus += (*i)->GetAmount();
12336 for (AuraEffectList::const_iterator i = mCreatureAttackPower.begin(); i != mCreatureAttackPower.end(); ++i)
12337 if (creatureTypeMask &
uint32((*i)->GetMiscValue()))
12338 APbonus += (*i)->GetAmount();
12343 bool normalized =
false;
12355 float DoneTotalMod = 1.0f;
12361 for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
12366 if (!
sScriptMgr->IsNeedModMeleeDamagePercent(
this, *i, DoneTotalMod, spellProto))
12371 if ((*i)->GetSpellInfo()->EquippedItemClass == -1)
12372 AddPct(DoneTotalMod, (*i)->GetAmount());
12374 AddPct(DoneTotalMod, (*i)->GetAmount());
12375 else if (
ToPlayer() &&
ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo()))
12376 AddPct(DoneTotalMod, (*i)->GetAmount());
12382 for (AuraEffectList::const_iterator i = mDamageDoneVersus.begin(); i != mDamageDoneVersus.end(); ++i)
12383 if (creatureTypeMask &
uint32((*i)->GetMiscValue()))
12385 AddPct(DoneTotalMod, (*i)->GetAmount());
12389 for (AuraEffectList::const_iterator i = mDamageDoneVersusAurastate.begin(); i != mDamageDoneVersusAurastate.end(); ++i)
12392 AddPct(DoneTotalMod, (*i)->GetAmount());
12397 for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
12402 if (!(*i)->IsAffectedOnSpell(spellProto))
12405 switch ((*i)->GetMiscValue())
12412 if ((*i)->GetSpellInfo()->SpellIconID == 2656)
12415 AddPct(DoneTotalMod, (*i)->GetAmount());
12422 AddPct(DoneTotalMod, (*i)->GetAmount());
12430 AddPct(DoneTotalMod, (*i)->GetSpellInfo()->GetRank() * 2.0f);
12441 AddPct(DoneTotalMod, (*i)->GetAmount());
12451 int32 bonus = -(*i)->GetBase()->GetEffect(0)->GetAmount();
12452 AddPct(DoneTotalMod, bonus);
12468 AddPct(DoneTotalMod, aurEff->GetAmount());
12476 DoneFlatBenefit = 0;
12477 DoneTotalMod = 1.0f;
12480 float tmpDamage = float(
int32(pdamage) + DoneFlatBenefit) * DoneTotalMod;
12488 return uint32(std::max(tmpDamage, 0.0f));
12496 int32 TakenFlatBenefit = 0;
12500 for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i)
12502 TakenFlatBenefit += (*i)->GetAmount();
12510 float TakenTotalMod = 1.0f;
12519 for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i)
12520 if ((*i)->GetCasterGUID() == attacker->
GetGUID() && (*i)->IsAffectedOnSpell(spellProto))
12521 AddPct(TakenTotalMod, (*i)->GetAmount());
12533 for (AuraEffectList::const_iterator i = mDamageDoneMechanic.begin(); i != mDamageDoneMechanic.end(); ++i)
12534 if (mechanicMask &
uint32(1 << ((*i)->GetMiscValue())))
12535 AddPct(TakenTotalMod, (*i)->GetAmount());
12553 for (AuraEffectList::const_iterator i = mModMeleeDamageTakenPercent.begin(); i != mModMeleeDamageTakenPercent.end(); ++i)
12554 AddPct(TakenTotalMod, (*i)->GetAmount());
12559 for (AuraEffectList::const_iterator i = mModRangedDamageTakenPercent.begin(); i != mModRangedDamageTakenPercent.end(); ++i)
12560 AddPct(TakenTotalMod, (*i)->GetAmount());
12567 TakenFlatBenefit = 0;
12568 TakenTotalMod = 1.0f;
12574 float ignoreModifier = 1.0f - TakenTotalMod;
12575 bool addModifier =
false;
12577 for (AuraEffectList::const_iterator j = ResIgnoreAuras.begin(); j != ResIgnoreAuras.end(); ++j)
12580 ApplyPct(ignoreModifier, (*j)->GetAmount());
12581 addModifier =
true;
12585 TakenTotalMod += ignoreModifier;
12588 float tmpDamage = (float(pdamage) + TakenFlatBenefit) * TakenTotalMod;
12591 return uint32(std::max(tmpDamage, 0.0f));
12614 immune.
type = type;
12622 if (itr->spellId == spellId && itr->type == type)
12641 for (AuraApplicationMap::iterator itr = auras.begin(); itr != auras.end();)
12643 SpellInfo const* spell = itr->second->GetBase()->GetSpellInfo();
12677 return floor((WeaponSpeed * PPM) / 600.0f);
12689 sScriptMgr->AnticheatSetUnderACKmount(player);
12701 data <<
uint32(VehicleId);
12705 player->GetSession()->SendPacket(&data);
12713 Pet* pet = player->GetPet();
12721 player->UnsummonPetTemporaryIfAny();
12732 data << player->GetCollisionHeight();
12733 player->GetSession()->SendPacket(&data);
12752 data << thisPlayer->GetCollisionHeight();
12753 thisPlayer->GetSession()->SendPacket(&data);
12779 sScriptMgr->AnticheatSetUnderACKmount(player);
12781 if (
Pet* pPet = player->GetPet())
12787 player->ResummonPetTemporaryUnSummonedIfAny();
12813 if (((
Player const*)eOwner)->duel->opponent == myOwner)
12838 if (victim->
IsPet())
12846 victimControlledUnit->SetInCombatWith(
this);
12848 victimControlledUnit->AddThreat(
this, 0.0f);
12855 if (!(victimOwner->IsInCombatWith(
this)))
12859 if (!victimOwner->IsInCombat() && victimOwner->IsAIEnabled)
12861 victimOwner->ToCreature()->AI()->AttackStart(
this);
12863 victimOwner->SetInCombatWith(
this);
12865 victimOwner->AddThreat(
this, 0.0f);
12876 owner->SetInCombatWith(victim);
12905 owner->SetInCombatWith(target, duration);
12946 if ((
IsAIEnabled && creature->AI()->IsEscorted()) ||
12954 creature->AI()->EnterCombat(enemy);
12956 if (creature->GetFormation())
12957 creature->GetFormation()->MemberAttackStart(creature, enemy);
12960 creature->RefreshSwimmingFlag();
12977 Unit* controlled = *itr;
12988 sEluna->OnPlayerEnterCombat(player, enemy);
13000 if (creature->GetCreatureTemplate() && creature->GetCreatureTemplate()->unit_flags &
UNIT_FLAG_IMMUNE_TO_PC)
13007 creature->SetAssistanceTimer(0);
13015 player->UpdatePotionCooldown();
13018 player->SetGracePeriod(i, 0);
13022 sEluna->OnPlayerLeaveCombat(player);
13064 if (
this == target)
13124 const Unit*
const thisUnit = owner ? owner :
this;
13150 if (playerAffectingAttacker && playerAffectingTarget)
13151 if (playerAffectingAttacker->
duel && playerAffectingAttacker->
duel->
opponent == playerAffectingTarget && playerAffectingAttacker->
duel->
startTime != 0)
13160 if (playerAffectingAttacker && playerAffectingTarget)
13162 if (target->
IsPvP())
13184 if (
this == target)
13241 if (selfPlayerOwner && targetPlayerOwner)
13244 if (selfPlayerOwner != targetPlayerOwner
13245 && targetPlayerOwner->
duel)
13253 if (target->
IsPvP())
13262 && !target->
IsPvP())
13279 int32 val = dVal + curHealth;
13288 if (val < maxHealth)
13291 gain = val - curHealth;
13293 else if (curHealth != maxHealth)
13296 gain = maxHealth - curHealth;
13311 int32 val = dVal + curHealth;
13319 if (val < maxHealth)
13321 else if (curHealth != maxHealth)
13322 gain = maxHealth - curHealth;
13337 int32 val = dVal + curPower;
13346 if (val < maxPower)
13349 gain = val - curPower;
13351 else if (curPower != maxPower)
13354 gain = maxPower - curPower;
13382 if (ownerPlayer->IsGroupVisibleFor(seerPlayer))
13399 if (ownerPlayer->IsGroupVisibleFor(seerPlayer))
13426 int32 main_speed_mod = 0;
13427 float stack_bonus = 1.0f;
13428 float non_stack_bonus = 1.0f;
13458 for (Unit::AuraEffectList::const_iterator itr = swimAuras.begin(); itr != swimAuras.end(); ++itr)
13461 if ((*itr)->GetId() == 64731 )
13463 SetSpeed(mtype,
AddPct(non_stack_bonus, (*itr)->GetAmount()), forced);
13468 ((*itr)->GetAmount() > 0 && (*itr)->GetAmount() > main_speed_mod) ||
13470 ((*itr)->GetAmount() < 0 && (*itr)->GetAmount() < main_speed_mod)
13473 main_speed_mod = (*itr)->GetAmount();
13486 int32 owner_speed_mod = 0;
13491 main_speed_mod = std::max(main_speed_mod, owner_speed_mod);
13509 LOG_ERROR(
"entities.unit",
"Unit::UpdateSpeed: Unsupported move type (%d)", mtype);
13514 float speed = std::max(non_stack_bonus, stack_bonus);
13515 if (main_speed_mod)
13516 AddPct(speed, main_speed_mod);
13540 if (speed > max_speed)
13549 int32 slowFromHealth = 0;
13563 if (slowFromHealth)
13565 AddPct(speed, slowFromHealth);
13576 float min_speed = base_speed * (minSpeedMod / 100.0f);
13577 if (speed < min_speed)
13635 LOG_ERROR(
"entities.unit",
"Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
13666 critter->UpdateSpeed(mtype, forced);
13700 LOG_ERROR(
"entities.unit",
"Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
13760 zoneScript->OnUnitDeath(
this);
13850 if (target && target == taunter)
13878 if (!target || target != taunter)
13890 if (target && target != taunter)
13906 Unit* target =
nullptr;
13910 if (!tauntAuras.empty())
13911 for (Unit::AuraEffectList::const_reverse_iterator itr = tauntAuras.rbegin(); itr != tauntAuras.rend(); ++itr)
13912 if (
Unit* caster = (*itr)->GetCaster())
13931 if (owner->IsInCombat())
13934 for (ControlSet::const_iterator itr = owner->m_Controlled.begin(); itr != owner->m_Controlled.end(); ++itr)
13935 if ((*itr)->IsInCombat())
13965 if (!iAuras.empty())
13967 for (Unit::AuraEffectList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
13968 if ((*itr)->GetBase()->IsPermanent())
13991 switch (effect_index)
14010 return spellProto->
Effects[effect_index].CalcValue(
this, basePoints, target);
14022 if (comboPoints && minduration != -1 && minduration != maxduration)
14023 duration = minduration +
int32((maxduration - minduration) * comboPoints / 5);
14025 duration = minduration;
14047 int32 durationMod_always = 0;
14048 int32 durationMod_not_stack = 0;
14052 if (!(mechanic & 1 << i))
14064 if (new_durationMod_always < durationMod_always)
14065 durationMod_always = new_durationMod_always;
14066 if (new_durationMod_not_stack < durationMod_not_stack)
14067 durationMod_not_stack = new_durationMod_not_stack;
14071 if (durationMod_always > durationMod_not_stack)
14072 durationMod = durationMod_not_stack;
14074 durationMod = durationMod_always;
14076 if (durationMod != 0)
14077 AddPct(duration, durationMod);
14084 if (durationMod_always > durationMod_not_stack)
14085 durationMod += durationMod_not_stack;
14087 durationMod += durationMod_always;
14089 if (durationMod != 0)
14090 AddPct(duration, durationMod);
14099 if (target ==
this)
14127 return std::max(duration, 0);
14132 if (!spellInfo || castTime < 0)
14168 if (i->DRGroup != group)
14195 if (i->DRGroup != group)
14215 if (limitduration > 0 && duration > limitduration)
14217 Unit const* target = targetOwner ? targetOwner :
this;
14218 Unit const* source = casterOwner ? casterOwner : caster;
14223 duration = limitduration;
14279 duration =
int32(duration * mod);
14288 if (i->DRGroup != group)
14310 if (target ==
nullptr)
14349 LOG_ERROR(
"entities.unit",
"ERROR in HandleStatModifier(): non-existing UnitMods or wrong UnitModifierType!");
14353 switch (modifierType)
14434 LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
14464 LOG_ERROR(
"entities.unit",
"attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
14481 if (val == -100.0f)
14483 float var =
GetStat(stat) * val / 100.0f;
14607 if (!showLevelChange)
14628 if (maxHealth < val)
14654 if (pet->isControlled())
14659 if (player->NeedSendSpectatorData() && pet->GetCreatureTemplate()->family)
14662 if (player->GetGroup())
14689 if (pet->isControlled())
14694 if (player->NeedSendSpectatorData() && pet->GetCreatureTemplate()->family)
14697 if (player->GetGroup())
14713 if (maxPower < val)
14720 data <<
uint8(power);
14736 if (pet->isControlled())
14766 if (pet->isControlled())
14774 if (val < cur_power)
14840 LOG_FATAL(
"entities.unit",
"Unit %u has charmer guid when removed from world",
GetEntry());
14846 if (owner->m_Controlled.find(
this) != owner->m_Controlled.end())
14849 owner->SetMinion((
Minion*)
this,
false);
14850 LOG_INFO(
"entities.unit",
"Unit %u is in controlled list of %u when removed from world",
GetEntry(), owner->GetEntry());
14949 _isCommandAttack(false), _isCommandFollow(false), _isAtStay(false), _isFollowing(false), _isReturning(false),
14950 _forcedSpellId(0), _stayX(0.0f), _stayY(0.0f), _stayZ(0.0f)
15371 switch (missCondition)
15426 void Unit::ProcDamageAndSpellFor(
bool isVictim,
Unit* target,
uint32 procFlag,
uint32 procExtra,
WeaponAttackType attType,
SpellInfo const* procSpellInfo,
uint32 damage,
SpellInfo const* procAura,
int8 procAuraEffectIndex,
Spell const* procSpell,
DamageInfo* damageInfo,
HealInfo* healInfo)
15518 Unit* actor = isVictim ? target :
this;
15519 Unit* actionTarget = !isVictim ? target :
this;
15521 ProcEventInfo eventInfo =
ProcEventInfo(actor, actionTarget, target, procFlag, 0, 0, procExtra, procSpell, damageInfo, healInfo, procAura, procAuraEffectIndex);
15528 if (procAura && procAura->
Id == itr->first)
15537 bool active = damage || (procExtra &
PROC_EX_BLOCK && isVictim);
15541 SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
15559 if (!
sConditionMgr->IsObjectMeetToConditions(condInfo, conditions))
15570 bool hasTriggeredProc =
false;
15573 if (itr->second->HasEffect(i))
15594 hasTriggeredProc =
true;
15603 triggerData.
effMask |= 1 << i;
15610 if (hasTriggeredProc)
15612 bool proccessed =
false;
15617 auto iter = std::find(procTriggered.begin(), procTriggered.end(), triggeredSpellId);
15618 if (iter != procTriggered.end())
15620 std::advance(iter, 1);
15621 procTriggered.insert(iter, triggerData);
15630 procTriggered.push_front(triggerData);
15635 procTriggered.push_front(triggerData);
15641 if (procTriggered.empty())
15649 for (ProcTriggeredList::const_iterator i = procTriggered.begin(); i != procTriggered.end(); ++i)
15652 if (i->aura->IsRemoved())
15655 bool useCharges = i->aura->IsUsingCharges();
15657 if (useCharges && !i->aura->GetCharges())
15660 bool takeCharges =
false;
15661 SpellInfo const* spellInfo = i->aura->GetSpellInfo();
15665 bool prepare = i->aura->CallScriptPrepareProcHandlers(aurApp, eventInfo);
15669 if (prepare && i->spellProcEvent && i->spellProcEvent->cooldown)
15670 cooldown = i->spellProcEvent->cooldown;
15679 bool handled = i->aura->CallScriptProcHandlers(aurApp, eventInfo);
15682 if (!handled &&
HandleAuraProc(target, damage, i->aura, procSpellInfo, procFlag, procExtra, cooldown, &handled))
15684 uint32 Id = i->aura->GetId();
15685 LOG_DEBUG(
"spells.aura",
"ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->
Id, (isVictim ?
"a victim's" :
"an attacker's"), Id);
15686 takeCharges =
true;
15692 if (!(i->effMask & (1 << effIndex)))
15695 AuraEffect* triggeredByAura = i->aura->GetEffect(effIndex);
15696 ASSERT(triggeredByAura);
15698 bool prevented = i->aura->CallScriptEffectProcHandlers(triggeredByAura, aurApp, eventInfo);
15701 takeCharges =
true;
15709 LOG_DEBUG(
"spells.aura",
"ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->
Id, (isVictim ?
"a victim's" :
"an attacker's"), triggeredByAura->
GetId());
15711 if (
HandleProcTriggerSpell(target, damage, triggeredByAura, procSpellInfo, procFlag, procExtra, cooldown))
15712 takeCharges =
true;
15722 takeCharges =
true;
15728 LOG_DEBUG(
"spells.aura",
"ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->
Id, (isVictim ?
"a victim's" :
"an attacker's"), triggeredByAura->
GetId());
15729 if (
HandleDummyAuraProc(target, damage, triggeredByAura, procSpellInfo, procFlag, procExtra, cooldown))
15730 takeCharges =
true;
15737 LOG_DEBUG(
"spells.aura",
"ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->
Id, isVictim ?
"a victim's" :
"an attacker's", triggeredByAura->
GetId());
15738 takeCharges =
true;
15742 LOG_DEBUG(
"spells.aura",
"ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->
Id, (isVictim ?
"a victim's" :
"an attacker's"), triggeredByAura->
GetId());
15744 takeCharges =
true;
15749 LOG_DEBUG(
"spells.aura",
"ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
15750 (isVictim ?
"a victim's" :
"an attacker's"), triggeredByAura->
GetId());
15754 takeCharges =
true;
15760 LOG_DEBUG(
"spells.aura",
"ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
15761 (isVictim ?
"a victim's" :
"an attacker's"), triggeredByAura->
GetId());
15763 takeCharges =
true;
15768 LOG_DEBUG(
"spells.aura",
"ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->
Id, (isVictim ?
"a victim's" :
"an attacker's"), triggeredByAura->
GetId());
15770 if (
HandleProcTriggerSpell(target, damage, triggeredByAura, procSpellInfo, procFlag, procExtra, cooldown))
15771 takeCharges =
true;
15780 takeCharges =
true;
15785 takeCharges =
true;
15790 takeCharges =
true;
15795 if (procSpellInfo &&
15798 takeCharges =
true;
15804 takeCharges =
true;
15809 takeCharges =
true;
15822 if ((!i->aura->IsPermanent() && i->aura->GetDuration() == i->aura->GetMaxDuration()) || procSpellInfo->
Id == triggeredByAura->
GetId() ||
15828 takeCharges =
true;
15833 if (damageLeft <
int32(damage))
15836 triggeredByAura->
SetAmount(damageLeft - damage);
15841 if (procSpellInfo && procSpellInfo->
Id == 20647)
15843 takeCharges =
true;
15846 takeCharges =
true;
15849 i->aura->CallScriptAfterEffectProcHandlers(triggeredByAura, aurApp, eventInfo);
15853 if (prepare && useCharges && takeCharges)
15855 i->aura->DropCharge();
15857 i->aura->CallScriptAfterProcHandlers(aurApp, eventInfo);
15873 for (std::list<AuraApplication*>::iterator itr = procAuras->begin(); itr != procAuras->end(); ++itr)
15875 ASSERT((*itr)->GetTarget() ==
this);
15876 if (!(*itr)->GetRemoveMode())
15877 if ((*itr)->GetBase()->IsProcTriggeredOnEvent(*itr, eventInfo))
15879 (*itr)->GetBase()->PrepareProcToTrigger(*itr, eventInfo);
15880 aurasTriggeringProc.push_back(*itr);
15889 if (itr->second->GetBase()->IsProcTriggeredOnEvent(itr->second, eventInfo))
15891 itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo);
15892 aurasTriggeringProc.push_back(itr->second);
15901 TriggerAurasProcOnEvent(
nullptr,
nullptr, damageInfo.
target, damageInfo.
procAttacker, damageInfo.
procVictim, 0, 0, damageInfo.
procEx,
nullptr, &dmgInfo,
nullptr);
15904 void Unit::TriggerAurasProcOnEvent(std::list<AuraApplication*>* myProcAuras, std::list<AuraApplication*>* targetProcAuras,
Unit* actionTarget,
uint32 typeMaskActor,
uint32 typeMaskActionTarget,
uint32 spellTypeMask,
uint32 spellPhaseMask,
uint32 hitMask,
Spell* spell,
DamageInfo* damageInfo,
HealInfo* healInfo)
15907 ProcEventInfo myProcEventInfo =
ProcEventInfo(
this, actionTarget, actionTarget, typeMaskActor, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
15908 std::list<AuraApplication*> myAurasTriggeringProc;
15912 ProcEventInfo targetProcEventInfo =
ProcEventInfo(
this, actionTarget,
this, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
15913 std::list<AuraApplication*> targetAurasTriggeringProc;
15914 if (typeMaskActionTarget)
15919 if (typeMaskActionTarget)
15925 for (std::list<AuraApplication*>::iterator itr = aurasTriggeringProc.begin(); itr != aurasTriggeringProc.end(); ++itr)
15927 if (!(*itr)->GetRemoveMode())
15928 (*itr)->GetBase()->TriggerProcOnEvent(*itr, eventInfo);
15957 data <<
uint8(msg);
15969 data <<
uint32(pettalk);
16053 data << (
uint8)state;
16085 if (!transforms.empty())
16088 for (Unit::AuraEffectList::const_reverse_iterator i = transforms.rbegin(); i != transforms.rend(); ++i)
16093 handledAura = (*i);
16097 handledAuraForced = (*i);
16105 if (!handledAuraForced && !handledAura)
16108 if (!cloneAuras.empty())
16109 for (Unit::AuraEffectList::const_iterator i = cloneAuras.begin(); i != cloneAuras.end(); ++i)
16116 if (handledAuraForced)
16121 else if (handledAura)
16195 std::list<Unit*> targets;
16205 targets.remove(exclude);
16208 for (std::list<Unit*>::iterator tIter = targets.begin(); tIter != targets.end();)
16212 std::list<Unit*>::iterator tIter2 = tIter;
16214 targets.erase(tIter2);
16221 if (targets.empty())
16230 std::list<Unit*> targets;
16240 targets.remove(exclude);
16243 for (std::list<Unit*>::iterator tIter = targets.begin(); tIter != targets.end();)
16247 std::list<Unit*>::iterator tIter2 = tIter;
16249 targets.erase(tIter2);
16256 if (targets.empty())
16293 if (CastingTime > 7000) CastingTime = 7000;
16294 if (CastingTime < 1500) CastingTime = 1500;
16297 CastingTime = 3500;
16299 int32 overTime = 0;
16301 bool DirectDamage =
false;
16302 bool AreaEffect =
false;
16306 switch (spellProto->
Effects[i].Effect)
16314 DirectDamage =
true;
16317 switch (spellProto->
Effects[i].ApplyAuraName)
16334 if (spellProto->
Effects[i].IsTargetingArea())
16339 if (overTime > 0 && DirectDamage)
16343 if (OriginalCastTime > 7000) OriginalCastTime = 7000;
16344 if (OriginalCastTime < 1500) OriginalCastTime = 1500;
16346 float PtOT = (overTime / 15000.0f) / ((overTime / 15000.0f) + (OriginalCastTime / 3500.0f));
16348 if (damagetype ==
DOT)
16349 CastingTime =
uint32(CastingTime * PtOT);
16350 else if (PtOT < 1.0f)
16351 CastingTime =
uint32(CastingTime * (1 - PtOT));
16372 for (
uint8 i = 0; i < effects; ++i)
16373 CastingTime *= 0.95f;
16375 return CastingTime;
16384 if (player->GetGroup())
16387 player->SetAuraUpdateMaskForRaid(slot);
16392 Pet* pet = ((
Pet*)
this);
16408 float DotFactor = 1.0f;
16409 if (damagetype ==
DOT)
16412 if (!spellInfo->
IsChanneled() && DotDuration > 0)
16413 DotFactor = DotDuration / 15000.0f;
16416 DotFactor /= DotTicks;
16424 return (CastingTime / 3500.0f) * DotFactor;
16436 switch (
Weapon->GetTemplate()->InventoryType)
16461 if (!player || ((attackedPlayer && (attackedPlayer == player || (player->
duel && player->
duel->
opponent == attackedPlayer))) || player->
InBattleground()))
16465 if (lookForNearContestedGuards)
16467 std::list<Unit*> targets;
16473 if (!targets.size())
16502 pet->CastPetAura(petSpell);
16504 charm->CastPetAura(petSpell);
16514 pet->RemoveAurasDueToSpell(petSpell->
GetAura(pet->GetEntry()));
16516 charm->RemoveAurasDueToSpell(petSpell->
GetAura(charm->GetEntry()));
16525 if (auraId == 35696)
16542 for (PetAuraSet::const_iterator itr = owner->
m_petAuras.begin(); itr != owner->
m_petAuras.end(); ++itr)
16601 LOG_ERROR(
"entities.unit",
"Pet::InitStatsForLevel() failed for creature (Entry: %u)!", pet->
GetEntry());
16618 if (
sSpellMgr->GetSpellProcEntry(spellProto->
Id))
16622 spellProcEvent =
sSpellMgr->GetSpellProcEvent(spellProto->
Id);
16626 if (spellProcEvent && spellProcEvent->
procFlags)
16627 EventProcFlag = spellProcEvent->
procFlags;
16631 if (!EventProcFlag)
16650 if (!
sSpellMgr->IsSpellProcEventCanTriggeredBy(spellProto, spellProcEvent, EventProcFlag, eventInfo, active))
16655 bool allow =
false;
16661 if (aura->
GetId() == 32409 || aura->
GetId() == 18372 || aura->
GetId() == 18213)
16668 if (procSpell && procSpell->
Id == spellProto->
Id
16678 Item* item =
nullptr;
16701 float chance = float(spellProto->
ProcChance);
16706 if (spellProcEvent && spellProcEvent->
ppmRate != 0)
16726 if (spellProto->
Id == 1719 && procSpell && procSpell->
Id == 44949)
16749 LOG_DEBUG(
"spells.aura",
"Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->
Id);
16766 std::list<Unit*> nearMembers;
16768 Player* player =
nullptr;
16779 if (player !=
this)
16782 nearMembers.push_back(player);
16787 nearMembers.push_back(pet);
16793 if (
Player* Target = itr->GetSource())
16799 if (Target !=
this && Target->IsAlive() && !
IsHostileTo(Target))
16800 nearMembers.push_back(Target);
16805 nearMembers.push_back(pet);
16809 if (!nearMembers.empty())
16812 if (
Unit* target = nearMembers.front())
16815 CastCustomSpell(target, spellProto->
Id, &heal,
nullptr,
nullptr,
true,
nullptr, triggeredByAura, caster_guid);
16816 if (
Aura* aura = target->GetAura(spellProto->
Id, caster->GetGUID()))
16817 aura->SetCharges(jumps);
16825 CastCustomSpell(
this, 33110, &heal,
nullptr,
nullptr,
true,
nullptr,
nullptr, caster_guid);
16834 switch (spellProto->
Id)
16837 damageSpellId = 57952;
16841 damageSpellId = 59979;
16844 damageSpellId = 43594;
16847 LOG_ERROR(
"entities.unit",
"Unit::HandleAuraRaidProcFromCharge, received unhandled spell: %u", spellProto->
Id);
16867 CastSpell(target, spellProto,
true,
nullptr, triggeredByAura, caster_guid);
16868 if (
Aura* aura = target->GetAura(spellProto->
Id, caster->GetGUID()))
16869 aura->SetCharges(jumps);
16874 CastSpell(
this, damageSpellId,
true,
nullptr, triggeredByAura, caster_guid);
16885 if (killer && !killer->
IsInMap(victim))
16892 bool isRewardAllowed =
true;
16896 if (!isRewardAllowed)
16901 if (isRewardAllowed && creature)
16904 if (lr && lr->
IsInMap(creature))
16907 for (
GroupReference* itr = lrg->GetFirstMember(); itr !=
nullptr; itr = itr->
next())
16908 if (
Player* member = itr->GetSource())
16909 if (member->IsAtLootRewardDistance(creature))
16918 isRewardAllowed =
false;
16922 if (isRewardAllowed && player && player != victim)
16928 Player* looter = player;
16930 bool hasLooterGuid =
false;
16944 hasLooterGuid =
true;
16957 data2 << creature->
GetGUID();
17000 if (killer != victim && !victim->
IsCritter())
17014 bool spiritOfRedemption =
false;
17047 victim->
CastSpell(victim, 27827,
true,
nullptr, aurEff);
17048 spiritOfRedemption =
true;
17053 if (!spiritOfRedemption)
17055 LOG_DEBUG(
"entities.unit",
"SET JUST_DIED");
17075 plrVictim->SetPvPDeath(player !=
nullptr);
17084 plrVictim->GetSession()->SendPacket(&data);
17091 if (plrVictim->duel)
17093 plrVictim->duel->opponent->CombatStopWithPets(
true);
17094 plrVictim->CombatStopWithPets(
true);
17100 LOG_DEBUG(
"entities.unit",
"DealDamageNotPlayer");
17116 creature->
AI()->
JustDied(killer ? killer : victim);
17119 if (
Unit* summoner = summon->GetSummonerUnit())
17120 if (summoner->ToCreature() && summoner->IsAIEnabled)
17121 summoner->ToCreature()->AI()->SummonedCreatureDies(creature, killer);
17130 if (instanceMap->
IsDungeon() && player)
17139 if (player && killer != victim)
17142 pvp->HandleKill(player, victim);
17145 bf->HandleKill(player, victim);
17157 bg->HandleKillPlayer(victim->
ToPlayer(), player);
17159 bg->HandleKillUnit(victim->
ToCreature(), player);
17177 sScriptMgr->OnPVPKill(killerPlr, killedPlr);
17179 sScriptMgr->OnCreatureKill(killerPlr, killedCre);
17184 sScriptMgr->OnPlayerKilledByCreature(killerCre, killed);
17412 Unit* caster =
nullptr;
17414 if (!fearAuras.empty())
17509 LOG_DEBUG(
"entities.unit",
"SetCharmedBy: charmer %u (%s), charmed %u (%s), type %u.",
17512 if (
this == charmer)
17530 LOG_FATAL(
"entities.unit",
"Unit::SetCharmedBy: %u (%s) has already been charmed but %u (%s) is trying to charm it!",
17561 LOG_FATAL(
"entities.unit",
"Unit::SetCharmedBy: %u (%s) is not in world but %u (%s) is trying to charm it!",
17589 if (player->
isAFK())
17663 creature->RefreshSwimmingFlag();
17762 LOG_ERROR(
"entities.unit",
"Aura::HandleModCharm: target=%s has a charm aura but no charm info!",
GetGUID().
ToString().c_str());
17773 sScriptMgr->AnticheatSetUnderACKmount(player);
17790 if (
Attack(charmer,
true))
17794 if (creature->AI())
17795 creature->AI()->OnCharmed(
false);
17939 Group* group =
nullptr;
17949 Player* Target = itr->GetSource();
17955 TagUnitMap.push_back(Target);
17957 for (Unit::ControlSet::iterator iterator = Target->
m_Controlled.begin(); iterator != Target->
m_Controlled.end(); ++iterator)
17959 if (
Unit* pet = *iterator)
17960 if (pet->IsGuardian() && pet->IsAlive())
17961 TagUnitMap.push_back(pet);
17969 TagUnitMap.push_back(owner);
17973 if (
Unit* pet = *itr)
17974 if (pet->IsGuardian() && pet->IsAlive())
17975 TagUnitMap.push_back(pet);
18005 if (!(effMask & (1 << i)))
18008 effMask &= ~(1 << i);
18023 aura =
AddAura(spellId, target);
18050 Unit const* target =
nullptr;
18121 int32 diff = -skillDiff;
18123 missChance += diff > 0 ? diff * 0.04f : diff * 0.02f;
18125 missChance += diff > 10 ? 1 + (diff - 10) * 0.4f : diff * 0.1f;
18128 float hitChance = 100.0f;
18137 missChance += hitChance - 100.0f;
18145 if (missChance < 0.0f)
18147 if (missChance > 60.0f)
18154 uint32 currentPhase = 0;
18156 if (!phases.empty())
18157 for (AuraEffectList::const_iterator itr = phases.begin(); itr != phases.end(); ++itr)
18158 currentPhase |= (*itr)->GetMiscValue();
18160 return currentPhase;
18174 if (!
sScriptMgr->CanSetPhaseMask(
this, newPhaseMask, update))
18200 offlineThreatList.sort();
18201 threatList.merge(offlineThreatList);
18203 for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
18204 if (
Unit* unit = (*itr)->getTarget())
18217 Unit* controlled = *itr;
18226 summon->SetPhaseMask(newPhaseMask,
true);
18237 float radius = 60.0f;
18250 if (player && player->
m_mover !=
this)
18267 data << float(vcos);
18268 data << float(vsin);
18269 data << float(speedXY);
18270 data << float(-speedZ);
18277 sScriptMgr->AnticheatSetSkipOnePacketForASH(player,
true);
18284 return player->GetRatingBonusValue(cr);
18288 return owner->GetRatingBonusValue(cr);
18361 else switch (skinColor)
18440 else switch (skinColor)
18604 float angle = forward ? 0 : M_PI;
18615 data << float(vcos);
18616 data << float(vsin);
18617 data << float(speedXY);
18618 data << float(-speedZ);
18634 bool result =
false;
18637 for (SpellClickInfoContainer::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
18640 if (!itr->second.IsFitToRequirements(clicker,
this))
18662 bool valid =
false;
18675 LOG_ERROR(
"sql.sql",
"Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId);
18685 bp0[j] = spellEntry->
Effects[j].BasePoints;
18715 sScriptMgr->AnticheatSetUnderACKmount(player);
18716 sScriptMgr->AnticheatSetSkipOnePacketForASH(player,
true);
18758 sScriptMgr->AnticheatSetUnderACKmount(player);
18759 sScriptMgr->AnticheatSetSkipOnePacketForASH(player,
true);
18762 player->StopCastingCharm();
18763 player->StopCastingBindSight();
18769 bg->EventPlayerDroppedFlag(player);
18772 player->GetSession()->SendPacket(&data);
18827 sScriptMgr->AnticheatSetUnderACKmount(player);
18828 sScriptMgr->AnticheatSetSkipOnePacketForASH(player,
true);
18866 pos = *exitPosition;
18870 pos.
Relocate(1776.0f, -24.0f, 448.75f, 0.0f);
18872 pos.
Relocate(2802.18f, 7054.91f, -0.6f, 4.67f);
18888 sScriptMgr->AnticheatSetUnderACKmount(player);
18889 sScriptMgr->AnticheatSetSkipOnePacketForASH(player,
true);
19042 void Unit::NearTeleportTo(
float x,
float y,
float z,
float orientation,
bool casting ,
bool vehicleTeleport ,
bool withPet ,
bool removeTransport )
19049 Position pos = {x, y, z, orientation};
19060 data <<
uint8(result);
19087 bool turn = (old_orientation != orientation);
19114 return (relocated || turn);
19144 for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
19146 data << (*itr)->getUnitGuid().WriteAsPacked();
19147 data <<
uint32((*itr)->getThreat() * 100);
19159 LOG_DEBUG(
"entities.unit",
"WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message");
19165 for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
19167 data << (*itr)->getUnitGuid().WriteAsPacked();
19168 data <<
uint32((*itr)->getThreat() * 100);
19176 LOG_DEBUG(
"entities.unit",
"WORLD: Send SMSG_THREAT_CLEAR Message");
19184 LOG_DEBUG(
"entities.unit",
"WORLD: Send SMSG_THREAT_REMOVE Message");
19199 rageconversion += 13.27f * (
getLevel() - 70);
19203 addRage = (damage / rageconversion * 7.5f + weaponSpeedHitFactor) / 2;
19210 addRage = damage / rageconversion * 2.5f;
19226 if (victim->GetFactionTemplateEntry()->faction == faction_id)
19239 for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
19241 if ((*itr)->GetFactionTemplateEntry()->faction == faction_id)
19243 (*itr)->AttackStop();
19244 itr = attackers.begin();
19253 (*itr)->StopAttackFaction(faction_id);
19258 LOG_ERROR(
"entities.unit",
"Unit::OutDebugInfo");
19260 LOG_INFO(
"entities.unit",
"OwnerGUID %s, MinionGUID %s, CharmerGUID %s, CharmedGUID %s",
19266 LOG_INFO(
"entities.unit",
"Summon Slot: ");
19271 LOG_INFO(
"entities.unit",
"Controlled List: ");
19273 LOG_INFO(
"entities.unit",
"%s, ", (*itr)->GetGUID().ToString().c_str());
19276 LOG_INFO(
"entities.unit",
"Aura List: ");
19278 LOG_INFO(
"entities.unit",
"%u, ", itr->first);
19283 LOG_INFO(
"entities.unit",
"Passenger List: ");
19286 LOG_INFO(
"entities.unit",
"%s, ", passenger->GetGUID().ToString().c_str());
19317 for (AuraEffectList::iterator i =
m_modAuras[auraType].begin(); i !=
m_modAuras[auraType].end(); ++i)
19328 if (
this == caster)
19375 G3D::Vector3 stayPos = G3D::Vector3();
19388 transport->CalculatePassengerPosition(stayPos.x, stayPos.y, stayPos.z);
19465 else if (owner->IsValidAttackTarget(target))
19521 if (
Player* player = (*itr))
19523 if (player->IsOnVehicle(
this) || !player->IsInWorld() || player->IsDuringRemoveFromWorld())
19526 if (player->m_seer && player->m_seer->IsInWorld())
19527 viewPoint = player->m_seer;
19536 float dx = active->m_last_notify_position.GetPositionX() - active->GetPositionX();
19537 float dy = active->m_last_notify_position.GetPositionY() - active->GetPositionY();
19538 float dz = active->m_last_notify_position.GetPositionZ() - active->GetPositionZ();
19539 float distsq = dx * dx + dy * dy + dz * dz;
19541 if (distsq < mindistsq)
19559 if (player->m_seer && player->m_seer->IsInWorld())
19560 viewPoint = player->m_seer;
19562 if (viewPoint->
GetMapId() != player->GetMapId() || !viewPoint->
IsPositionValid() || !player->IsPositionValid())
19567 if (active->IsVehicle())
19570 if (!player->GetFarSightDistance())
19572 float dx = active->m_last_notify_position.
GetPositionX() - active->GetPositionX();
19573 float dy = active->m_last_notify_position.GetPositionY() - active->GetPositionY();
19574 float dz = active->m_last_notify_position.GetPositionZ() - active->GetPositionZ();
19575 float distsq = dx * dx + dy * dy + dz * dz;
19578 if (distsq < mindistsq)
19581 active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
19589 if (!player->GetFarSightDistance())
19600 if (!unit->IsPositionValid())
19603 float dx = unit->m_last_notify_position.GetPositionX() - unit->GetPositionX();
19604 float dy = unit->m_last_notify_position.GetPositionY() - unit->GetPositionY();
19605 float dz = unit->m_last_notify_position.GetPositionZ() - unit->GetPositionZ();
19606 float distsq = dx * dx + dy * dy + dz * dz;
19608 if (distsq < mindistsq)
19611 unit->m_last_notify_position.Relocate(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ());
19627 float radius = 60.0f;
19823 if (target ==
this)
19845 updateMask.
SetBit(index);
19869 fieldBuffer <<
uint32(appendValue);
19897 fieldBuffer <<
uint32(appendValue);
19913 cinfo = transformInfo;
19936 fieldBuffer <<
uint32(displayId);
19961 fieldBuffer << dynamicFlags;
19991 if (!
sScriptMgr->IsCustomBuildValuesUpdate(
this, updateType, fieldBuffer, target, index))
20004 data->
append(fieldBuffer);
20011 data <<
uint8(flags);
20012 data <<
uint32(spellId);
20013 data <<
uint32(cooldown);
20020 data <<
uint8(flags);
20021 for (std::unordered_map<uint32, uint32>::const_iterator itr = cooldowns.begin(); itr != cooldowns.end(); ++itr)
20023 data <<
uint32(itr->first);
20024 data <<
uint32(itr->second);
20092 if (G3D::fuzzyGt(mountModelData->CollisionWidth, modelData->
CollisionWidth))
20093 modelData = mountModelData;
20100 return G3D::fuzzyGt(collisionWidth, 0.0f) && (G3D::fuzzyEq(objectSize,defaultSize) ||
IsMounted()) ? collisionWidth : objectSize;
20123 float collisionHeight = 0.0f;
20131 collisionHeight = scaleMod * (mountModelData->MountHeight + modelData->
CollisionHeight * modelData->
Scale * displayInfo->
scale * 0.5f);
20138 return collisionHeight == 0.0f ? defaultHeight : collisionHeight;
20181 LOG_ERROR(
"entities.unit",
"Unit::Talk: `broadcast_text` (ID: %u) was not found", textId);
20216 LOG_ERROR(
"entities.unit",
"Unit::Whisper: `broadcast_text` was not %u found", textId);
constexpr auto IN_MILLISECONDS
@ CONDITION_SOURCE_TYPE_SPELL_PROC
std::list< Condition * > ConditionList
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
@ CREATURE_FLAG_EXTRA_NO_BLOCK
@ CREATURE_FLAG_EXTRA_NO_CRUSHING_BLOWS
@ CREATURE_FLAG_EXTRA_NO_CRIT
@ CREATURE_FLAG_EXTRA_TRIGGER
@ CREATURE_FLAG_EXTRA_INSTANCE_BIND
@ CREATURE_FLAG_EXTRA_OBEYS_TAUNT_DIMINISHING_RETURNS
@ CREATURE_FLAG_EXTRA_NO_PARRY
@ CREATURE_FLAG_EXTRA_NO_DODGE
@ CREATURE_FLAG_EXTRA_ALL_DIMINISH
#define MAX_AGGRO_RESET_TIME
@ ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE
@ ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER
@ ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE
@ ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE
@ ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS
@ FACTION_TEMPLATE_FLAG_HATES_ALL_EXCEPT_FRIENDS
@ FACTION_TEMPLATE_FLAG_ATTACK_PVP_ACTIVE_PLAYERS
DBCStorage< VehicleEntry > sVehicleStore(VehicleEntryfmt)
DBCStorage< LiquidTypeEntry > sLiquidTypeStore(LiquidTypefmt)
DBCStorage< FactionEntry > sFactionStore(FactionEntryfmt)
DBCStorage< SpellShapeshiftEntry > sSpellShapeshiftStore(SpellShapeshiftfmt)
DBCStorage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore(CreatureDisplayInfofmt)
DBCStorage< CreatureModelDataEntry > sCreatureModelDataStore(CreatureModelDatafmt)
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
#define MAX_SPELL_EFFECTS
@ GROUP_UPDATE_FLAG_CUR_HP
@ GROUP_UPDATE_FLAG_PET_CUR_HP
@ GROUP_UPDATE_FLAG_POWER_TYPE
@ GROUP_UPDATE_FLAG_PET_CUR_POWER
@ GROUP_UPDATE_FLAG_PET_MAX_POWER
@ GROUP_UPDATE_FLAG_MAX_HP
@ GROUP_UPDATE_FLAG_PET_POWER_TYPE
@ GROUP_UPDATE_FLAG_MAX_POWER
@ GROUP_UPDATE_FLAG_PET_AURAS
@ GROUP_UPDATE_FLAG_AURAS
@ GROUP_UPDATE_FLAG_LEVEL
@ GROUP_UPDATE_FLAG_PET_MAX_HP
@ GROUP_UPDATE_FLAG_CUR_POWER
@ CONFIG_CREATURE_FAMILY_FLEE_DELAY
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_PERIOD
@ CONFIG_DURABILITY_LOSS_IN_PVP
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP
@ RATE_DURABILITY_LOSS_DAMAGE
@ RATE_DURABILITY_LOSS_ON_DEATH
@ CONFIG_LISTEN_RANGE_YELL
@ CONFIG_LISTEN_RANGE_SAY
@ CONFIG_LISTEN_RANGE_TEXTEMOTE
@ ITEM_SUBCLASS_WEAPON_DAGGER
@ ITEM_SUBCLASS_WEAPON_WAND
#define LOG_FATAL(filterType__,...)
#define LOG_INFO(filterType__,...)
#define LOG_ERROR(filterType__,...)
#define LOG_DEBUG(filterType__,...)
LootStore LootTemplates_Creature("creature_loot_template", "creature entry", true)
#define MAP_LIQUID_STATUS_SWIMMING
@ NOTIFY_VISIBILITY_CHANGED
#define MAX_VISIBILITY_DISTANCE
#define DEFAULT_COLLISION_HEIGHT
#define DEFAULT_WORLD_OBJECT_SIZE
#define NOMINAL_MELEE_RANGE
#define VISIBILITY_INC_FOR_GOBJECTS
#define DEFAULT_COMBAT_REACH
#define VISIBILITY_COMPENSATION
std::pair< SpellClickInfoContainer::const_iterator, SpellClickInfoContainer::const_iterator > SpellClickInfoMapBounds
@ TELE_TO_NOT_LEAVE_VEHICLE
@ TELE_TO_NOT_LEAVE_COMBAT
@ TELE_TO_NOT_UNSUMMON_PET
@ TELE_TO_NOT_LEAVE_TRANSPORT
@ PLAYER_FLAGS_CONTESTED_PVP
std::map< uint32, SpellCooldown > SpellCooldowns
@ DELAYED_VEHICLE_TELEPORT
std::unordered_map< uint32, PlayerSpell * > PlayerSpellMap
@ EQUIPMENT_SLOT_MAINHAND
#define INVENTORY_SLOT_BAG_0
float frand(float min, float max)
int32 irand(int32 min, int32 max)
uint32 urand(uint32 min, uint32 max)
bool roll_chance_f(float chance)
bool roll_chance_i(int chance)
@ SERVERSIDE_VISIBILITY_GM
@ SERVERSIDE_VISIBILITY_GHOST
@ EMOTE_ONESHOT_WOUND_CRITICAL
@ EMOTE_ONESHOT_PARRY_SHIELD
@ CHAT_MSG_MONSTER_WHISPER
@ CHAT_MSG_RAID_BOSS_WHISPER
@ CHAT_MSG_RAID_BOSS_EMOTE
@ SPELL_ATTR7_DONT_CAUSE_SPELL_PUSHBACK
@ SPELL_ATTR7_DISPEL_REMOVES_CHARGES
@ SPELL_ATTR7_NO_ATTACK_PARRY
@ SPELL_ATTR7_NO_ATTACK_MISS
@ SPELL_ATTR7_NO_ATTACK_DODGE
@ SPELL_ATTR7_DISABLE_AURA_WHILE_DEAD
@ SPELL_ATTR7_NO_TARGET_DURATION_MOD
@ SPELL_EFFECT_POWER_BURN
@ SPELL_EFFECT_HEALTH_LEECH
@ SPELL_EFFECT_NORMALIZED_WEAPON_DMG
@ SPELL_EFFECT_ADD_EXTRA_ATTACKS
@ SPELL_EFFECT_ENVIRONMENTAL_DAMAGE
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
@ SPELL_EFFECT_POWER_DRAIN
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC
@ SPELL_ATTR5_ALLOW_ACTION_DURING_CHANNEL
@ SPELL_ATTR5_AURA_AFFECTS_NOT_JUST_REQ_EQUIPED_ITEM
@ SPELL_ATTR5_REMOVE_ENTERING_ARENA
constexpr auto MAX_SPELL_SCHOOL
@ NPC_CLICK_CAST_TARGET_CLICKER
@ NPC_CLICK_CAST_ORIG_CASTER_OWNER
@ NPC_CLICK_CAST_CASTER_CLICKER
@ SPELL_ATTR2_AUTO_REPEAT
@ SPELL_ATTR2_ALLOW_DEAD_TARGET
@ SPELL_ATTR2_IGNORE_LINE_OF_SIGHT
@ SPELL_ATTR2_DO_NOT_RESET_COMBAT_TIMERS
@ SPELL_ATTR2_NO_SCHOOL_IMMUNITIES
@ CREATURE_TYPE_NON_COMBAT_PET
@ SPELL_ATTR1_IMMUNITY_PURGES_EFFECT
@ SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS
@ SPELL_ATTR1_NO_REDIRECTION
SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask)
uint32 const CREATURE_TYPEMASK_DEMON_OR_UNDEAD
@ UNIT_DYNFLAG_SPECIALINFO
@ UNIT_DYNFLAG_TAPPED_BY_PLAYER
@ UNIT_DYNFLAG_TRACK_UNIT
@ SPELL_ATTR3_TREAT_AS_PERIODIC
@ SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD
@ SPELL_ATTR3_NO_PROC_EQUIP_REQUIREMENT
@ SPELL_ATTR3_INSTANT_TARGET_PROCS
@ SPELL_ATTR3_COMPLETELY_BLOCKED
@ SPELL_ATTR3_IGNORE_CASTER_MODIFIERS
@ SPELL_DAMAGE_CLASS_RANGED
@ SPELL_DAMAGE_CLASS_MAGIC
@ SPELL_DAMAGE_CLASS_NONE
@ SPELL_DAMAGE_CLASS_MELEE
#define PER_CASTER_AURA_STATE_MASK
@ SPELLFAMILY_DEATHKNIGHT
@ SPELL_ATTR0_NO_ACTIVE_DEFENSE
@ SPELL_ATTR0_NO_IMMUNITIES
@ AURA_STATE_HEALTHLESS_35_PERCENT
@ AURA_STATE_HEALTH_ABOVE_75_PERCENT
@ AURA_STATE_HEALTHLESS_20_PERCENT
@ AURA_STATE_HUNTER_PARRY
@ SPELL_FAILED_OUT_OF_RANGE
@ SPELL_FAILED_LINE_OF_SIGHT
@ SPELL_FAILED_SPELL_UNAVAILABLE
#define MAX_SPELL_IMMUNITY
@ SPELL_ATTR4_OWNER_POWER_SCALING
@ SPELL_ATTR4_ALLOW_ENETRING_ARENA
@ SPELL_ATTR4_NO_CAST_LOG
@ SPELL_ATTR4_REACTIVE_DAMAGE_PROC
@ CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT
@ CREATURE_TYPE_FLAG_CAN_ASSIST
@ CREATURE_TYPE_FLAG_ALLOW_MOUNTED_COMBAT
@ SPELL_ATTR6_CAN_TARGET_UNTARGETABLE
@ SPELL_ATTR6_IGNORE_HEALTH_MODIFIERS
@ SPELL_ATTR6_IGNORE_CASTER_DAMAGE_MODIFIERS
@ SPELL_ATTR6_IGNORE_PHASE_SHIFT
@ SPELL_ATTR6_DO_NOT_CONSUME_RESOURCES
@ SPELL_ATTR6_CAN_ASSIST_IMMUNE_PC
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_SCHOOL_MASK_SHADOW
@ SPELL_SCHOOL_MASK_MAGIC
@ SPELL_SCHOOL_MASK_NATURE
@ SPELL_SCHOOL_MASK_FROST
@ SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS
@ SPELL_AURA_MOD_CRIT_PERCENT_VERSUS
@ SPELL_AURA_CLONE_CASTER
@ SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK
@ SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL
@ SPELL_AURA_MOD_ATTACK_POWER
@ SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE
@ SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK
@ SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED
@ SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS
@ SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER
@ SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE
@ SPELL_AURA_MOD_PARRY_PERCENT
@ SPELL_AURA_ABILITY_IGNORE_AURASTATE
@ SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE
@ SPELL_AURA_MOD_IGNORE_TARGET_RESIST
@ SPELL_AURA_MOD_SHAPESHIFT
@ SPELL_AURA_MOD_DAMAGE_DONE_VERSUS
@ SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT
@ SPELL_AURA_DAMAGE_SHIELD
@ SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE
@ SPELL_AURA_OBS_MOD_HEALTH
@ SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK
@ SPELL_AURA_PERIODIC_HEALTH_FUNNEL
@ SPELL_AURA_PERIODIC_MANA_LEECH
@ SPELL_AURA_MOD_DEBUFF_RESISTANCE
@ SPELL_AURA_MOD_POSSESS_PET
@ SPELL_AURA_MOD_INCREASE_SPEED
@ SPELL_AURA_MOD_RESISTANCE
@ SPELL_AURA_MOD_EXPERTISE
@ SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS
@ SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_HASTE_SPELLS
@ SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER
@ SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE
@ SPELL_AURA_MOD_POWER_REGEN
@ SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK
@ SPELL_AURA_MOD_HEALING_DONE_PERCENT
@ SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS
@ SPELL_AURA_SHARE_DAMAGE_PCT
@ SPELL_AURA_OBS_MOD_POWER
@ SPELL_AURA_ADD_CASTER_HIT_TRIGGER
@ SPELL_AURA_SPLIT_DAMAGE_FLAT
@ SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE
@ SPELL_AURA_REFLECT_SPELLS
@ SPELL_AURA_CONTROL_VEHICLE
@ SPELL_AURA_IGNORE_HIT_DIRECTION
@ SPELL_AURA_IGNORE_COMBAT_RESULT
@ SPELL_AURA_MOD_MELEE_HASTE
@ SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS
@ SPELL_AURA_SPIRIT_OF_REDEMPTION
@ SPELL_AURA_MOD_SPEED_NOT_STACK
@ SPELL_AURA_SCHOOL_HEAL_ABSORB
@ SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED
@ SPELL_AURA_MOD_SPELL_CRIT_CHANCE
@ SPELL_AURA_MOD_INVISIBILITY
@ SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_MOD_ENEMY_DODGE
@ SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE
@ SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL
@ SPELL_AURA_MOD_DODGE_PERCENT
@ SPELL_AURA_MOD_INCREASE_SWIM_SPEED
@ SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT
@ SPELL_AURA_ADD_TARGET_TRIGGER
@ SPELL_AURA_SPLIT_DAMAGE_PCT
@ SPELL_AURA_DEFLECT_SPELLS
@ SPELL_AURA_MOD_CRIT_DAMAGE_BONUS
@ SPELL_AURA_MOD_HEALING_DONE
@ SPELL_AURA_MOD_HEALING_RECEIVED
@ SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL
@ SPELL_AURA_MOD_HEALING_PCT
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
@ SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT
@ SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE
@ SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
@ SPELL_AURA_MOD_ARMOR_PENETRATION_PCT
@ SPELL_AURA_MECHANIC_DURATION_MOD
@ SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE
@ SPELL_AURA_MOD_POWER_COST_SCHOOL
@ SPELL_AURA_MECHANIC_IMMUNITY
@ SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE
@ SPELL_AURA_RAID_PROC_FROM_CHARGE
@ SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN
@ SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT
@ SPELL_AURA_MOD_DAMAGE_TAKEN
@ SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE
@ SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS
@ SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE
@ SPELL_AURA_MOD_CRIT_PCT
@ SPELL_AURA_MOD_MINIMUM_SPEED
@ SPELL_AURA_MOD_BLOCK_CRIT_CHANCE
@ SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT
@ SPELL_AURA_MOD_TARGET_RESISTANCE
@ SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS
@ SPELL_AURA_MOD_SPEED_ALWAYS
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_REDUCE_PUSHBACK
@ SPELL_AURA_MOD_COMBAT_RESULT_CHANCE
@ SPELL_AURA_PERIODIC_ENERGIZE
@ SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS
@ SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
@ SPELL_AURA_MOD_DAMAGE_DONE_CREATURE
@ SPELL_AURA_SPELL_MAGNET
@ SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL
@ SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER
@ SPELL_AURA_PERIODIC_LEECH
@ SPELL_AURA_PROC_TRIGGER_DAMAGE
@ SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE
@ SPELL_AURA_MOD_DAMAGE_FROM_CASTER
@ SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT
@ SPELL_AURA_DAMAGE_IMMUNITY
@ SPELL_AURA_MOD_DAMAGE_DONE
@ SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST
@ SPELL_AURA_MOD_AOE_AVOIDANCE
@ SPELL_AURA_REFLECT_SPELLS_SCHOOL
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT
@ SPELL_AURA_MOD_MECHANIC_RESISTANCE
@ SPELL_AURA_MOD_UNATTACKABLE
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
@ SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK
@ SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED
@ SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED
@ SPELL_AURA_MOD_BLOCK_PERCENT
@ AURA_EFFECT_HANDLE_STAT
@ AURA_EFFECT_HANDLE_REAL
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT
@ SPELL_ATTR0_CU_IGNORE_ARMOR
@ SPELL_ATTR0_CU_ENCHANT_PROC
@ SPELL_ATTR0_CU_NO_POSITIVE_TAKEN_BONUS
@ SPELL_ATTR0_CU_DIRECT_DAMAGE
@ SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET
@ SPELL_ATTR0_CU_SINGLE_AURA_STACK
@ SPELL_ATTR0_CU_BINARY_SPELL
@ SPELL_ATTR0_CU_SCHOOLMASK_NORMAL_WITH_MAGIC
@ SPELL_SPECIFIC_MAGE_POLYMORPH
DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group)
DiminishingLevels GetDiminishingReturnsMaxLevel(DiminishingGroup group)
#define MELEE_BASED_TRIGGER_MASK
@ PROC_EX_INTERNAL_CANT_PROC
@ PROC_EX_INTERNAL_TRIGGERED
@ PROC_EX_INTERNAL_REQ_FAMILY
@ PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS
@ PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK
@ PROC_FLAG_DONE_PERIODIC
@ PROC_FLAG_DONE_MELEE_AUTO_ATTACK
@ PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS
@ PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG
@ PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS
@ PROC_FLAG_TAKEN_PERIODIC
@ PROC_FLAG_DONE_MAINHAND_ATTACK
@ PROC_FLAG_DONE_RANGED_AUTO_ATTACK
@ PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG
@ PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS
@ PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK
@ PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS
@ PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS
@ PROC_FLAG_DONE_OFFHAND_ATTACK
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG
uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
float baseMoveSpeed[MAX_MOVE_TYPE]
static bool isAlwaysTriggeredAura[TOTAL_AURAS]
static bool InitTriggerAuraData()
static bool isNonTriggerAura[TOTAL_AURAS]
void createProcFlags(const SpellInfo *spellInfo, WeaponAttackType attackType, bool positive, uint32 &procAttacker, uint32 &procVictim)
static bool isTriggerAura[TOTAL_AURAS]
std::list< ProcTriggeredData > ProcTriggeredList
uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
float playerBaseMoveSpeed[MAX_MOVE_TYPE]
@ AURA_INTERRUPT_FLAG_TAKE_DAMAGE
@ AURA_INTERRUPT_FLAG_DIRECT_DAMAGE
@ AURA_INTERRUPT_FLAG_MOVE
@ AURA_INTERRUPT_FLAG_TURNING
@ AURA_INTERRUPT_FLAG_NOT_ABOVEWATER
@ AURA_INTERRUPT_FLAG_NOT_SEATED
@ AURA_INTERRUPT_FLAG_NOT_UNDERWATER
@ AURA_INTERRUPT_FLAG_MELEE_ATTACK
@ AURA_INTERRUPT_FLAG_LEAVE_COMBAT
@ AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT
@ AURA_INTERRUPT_FLAG_MOUNT
@ AURA_INTERRUPT_FLAG_NOT_MOUNTED
@ MOVEMENTFLAG_SPLINE_ENABLED
@ MOVEMENTFLAG_ONTRANSPORT
@ MOVEMENTFLAG_WATERWALKING
@ MOVEMENTFLAG_MASK_MOVING
@ MOVEMENTFLAG_DISABLE_GRAVITY
@ MOVEMENTFLAG_FALLING_SLOW
@ MOVEMENTFLAG_MASK_MOVING_FLY
@ MOVEMENTFLAG_FALLING_FAR
@ MOVEMENTFLAG_SPLINE_ELEVATION
@ MOVEMENTFLAG_PENDING_ROOT
@ UNIT_MASK_CONTROLABLE_GUARDIAN
#define MAX_UNIT_ACTION_BAR_INDEX
@ SPELLMOD_CHANCE_OF_SUCCESS
@ SPELLMOD_CRIT_DAMAGE_BONUS
@ SPELLMOD_CRITICAL_CHANCE
@ SPELLMOD_BONUS_MULTIPLIER
@ SPELLMOD_PROC_PER_MINUTE
@ SPELLMOD_RESIST_MISS_CHANCE
#define SUMMON_SLOT_MINIPET
@ UNIT_MOD_DAMAGE_OFFHAND
@ UNIT_MOD_STAT_INTELLECT
@ UNIT_MOD_RESISTANCE_SHADOW
@ UNIT_MOD_RESISTANCE_FROST
@ UNIT_MOD_RESISTANCE_HOLY
@ UNIT_MOD_RESISTANCE_ARCANE
@ UNIT_MOD_RESISTANCE_FIRE
@ UNIT_MOD_RESISTANCE_NATURE
@ UNIT_MOD_DAMAGE_MAINHAND
@ UNIT_MOD_ATTACK_POWER_RANGED
@ HITINFO_SWINGNOHITSOUND
@ ACTION_BAR_INDEX_PET_SPELL_START
@ ACTION_BAR_INDEX_PET_SPELL_END
#define CURRENT_FIRST_NON_MELEE_SPELL
@ UNIT_STAND_STATE_SIT_HIGH_CHAIR
@ UNIT_STAND_STATE_SIT_MEDIUM_CHAIR
@ UNIT_STAND_STATE_SIT_LOW_CHAIR
@ UNIT_STAND_STATE_SIT_CHAIR
@ AURA_REMOVE_BY_ENEMY_SPELL
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ TRIGGERED_NO_PERIODIC_RESET
Will ignore equipped item requirements.
@ TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE
Will ignore caster aura states including combat requirements and death state.
#define ATTACK_DISPLAY_DELAY
#define CURRENT_MAX_SPELL
@ CR_WEAPON_SKILL_OFFHAND
@ CR_WEAPON_SKILL_MAINHAND
@ DIMINISHING_LEVEL_IMMUNE
@ DIMINISHING_LEVEL_TAUNT_IMMUNE
@ UNIT_BYTES_1_OFFSET_ANIM_TIER
@ UNIT_BYTES_1_OFFSET_STAND_STATE
@ UNIT_NPC_FLAG_SPELLCLICK
@ UNIT_NPC_FLAG_PLAYER_VEHICLE
@ UNIT_NPC_FLAG_FLIGHTMASTER
@ CURRENT_CHANNELED_SPELL
@ CURRENT_AUTOREPEAT_SPELL
@ SPELL_INTERRUPT_FLAG_ABORT_ON_DMG
@ SPELL_INTERRUPT_FLAG_PUSH_BACK
std::list< std::pair< Aura *, uint8 > > DispelChargesList
static constexpr uint32 MAX_CREATURE_SPELLS
std::unordered_map< uint32, uint32 > PacketCooldowns
@ MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING
@ MOVEMENTFLAG2_INTERPOLATED_MOVEMENT
#define MAX_GAMEOBJECT_SLOT
@ UNIT_BYTE2_FLAG_SANCTUARY
@ UNIT_STATE_ATTACK_PLAYER
@ UNIT_STATE_UNATTACKABLE
@ UNIT_STATE_CANNOT_AUTOATTACK
@ UNIT_STATE_NO_ENVIRONMENT_UPD
@ UNIT_STATE_MELEE_ATTACKING
@ SUMMON_TYPE_TOTEM_EARTH
@ SUMMON_TYPE_TOTEM_WATER
std::vector< SpellImmune > SpellImmuneList
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_NON_ATTACKABLE_2
@ UNIT_FLAG_IMMUNE_TO_NPC
@ UNIT_FLAG_NOT_SELECTABLE
@ UNIT_FLAG_NOT_ATTACKABLE_1
@ UNIT_FLAG_PLAYER_CONTROLLED
@ UNIT_FLAG_PET_IN_COMBAT
@ UNIT_FLAG2_IGNORE_REPUTATION
@ UPDATEFLAG_STATIONARY_POSITION
uint32 UnitUpdateFieldFlags[PLAYER_END]
@ PLAYER_RANGED_CRIT_PERCENTAGE
@ PLAYER_SPELL_CRIT_PERCENTAGE1
@ UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE
@ UNIT_FIELD_RANGEDATTACKTIME
@ UNIT_FIELD_ATTACK_POWER_MODS
@ PLAYER_OFFHAND_CRIT_PERCENTAGE
@ PLAYER_BLOCK_PERCENTAGE
@ UNIT_FIELD_FACTIONTEMPLATE
@ UNIT_FIELD_RANGED_ATTACK_POWER
@ UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER
@ UNIT_FIELD_MAXOFFHANDDAMAGE
@ UNIT_FIELD_MOUNTDISPLAYID
@ UNIT_FIELD_MAXRANGEDDAMAGE
@ UNIT_FIELD_ATTACK_POWER_MULTIPLIER
@ UNIT_FIELD_ATTACK_POWER
@ UNIT_FIELD_PET_NAME_TIMESTAMP
@ UNIT_FIELD_MINRANGEDDAMAGE
@ UNIT_FIELD_RANGED_ATTACK_POWER_MODS
@ UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE
@ UNIT_FIELD_MINOFFHANDDAMAGE
@ UNIT_FIELD_BASEATTACKTIME
T RoundToInterval(T &num, T floor, T ceil)
T ApplyPct(T &base, U pct)
void ApplyPercentModFloatVar(float &var, float val, bool apply)
T CalculatePct(T base, U pct)
@ VEHICLE_SPELL_PARACHUTE
@ VEHICLE_SPELL_SHADE_CONTROL_END
@ VEHICLE_SPELL_GEIST_CONTROL_END
@ VEHICLE_SPELL_RIDE_HARDCODED
void SetRemoveMode(AuraRemoveMode mode)
uint8 GetEffectMask() const
void _HandleEffect(uint8 effIndex, bool apply)
AuraRemoveMode GetRemoveMode() const
bool HasEffect(uint8 effect) const
void ChangeAmount(int32 newAmount, bool mark=true, bool onStackOrReapply=false)
uint32 GetTickNumber() const
AuraType GetAuraType() const
bool CanBeRecalculated() const
int32 GetOldAmount() const
int32 GetTotalTicks() const
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply)
SpellInfo const * GetSpellInfo() const
void SetAmount(int32 amount)
int32 GetMiscValue() const
uint32 GetEffIndex() const
void HandleProcTriggerDamageAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
void ResetPeriodic(bool resetPeriodicTimer=false)
int32 GetBaseAmount() const
ObjectGuid GetCasterGUID() const
virtual void _UnapplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
int32 GetMaxDuration() const
void CallScriptEffectAbsorbHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount, bool &defaultPrevented)
void CallScriptDispel(DispelInfo *dispelInfo)
void SetStackAmount(uint8 num)
AuraEffect * GetEffect(uint8 effIndex) const
static Aura * TryCreate(SpellInfo const *spellproto, uint8 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount=nullptr, Item *castItem=nullptr, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemGUID=ObjectGuid::Empty)
ObjectGuid GetCasterGUID() const
bool HasEffect(uint8 effIndex) const
bool CanStackWith(Aura const *checkAura, bool remove) const
bool IsSingleTargetWith(Aura const *aura) const
bool ModCharges(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
bool IsAppliedOnTarget(ObjectGuid guid) const
int32 GetDuration() const
void UpdateOwner(uint32 diff, WorldObject *owner)
void UnregisterSingleTarget()
bool IsDeathPersistent() const
bool HasEffectType(AuraType type) const
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool periodicReset=false)
WorldObject * GetOwner() const
ApplicationMap const & GetApplicationMap()
SpellInfo const * GetSpellInfo() const
void SetCharges(uint8 charges)
bool CallScriptCheckProcHandlers(AuraApplication const *aurApp, ProcEventInfo &eventInfo)
void SetNeedClientUpdateForTargets() const
static Aura * TryRefreshStackOrCreate(SpellInfo const *spellproto, uint8 tryEffMask, WorldObject *owner, Unit *caster, int32 *baseAmount=nullptr, Item *castItem=nullptr, ObjectGuid casterGUID=ObjectGuid::Empty, bool *refresh=nullptr, bool periodicReset=false)
uint8 GetEffectMask() const
void SetDuration(int32 duration, bool withMods=false)
const AuraApplication * GetApplicationOfTarget(ObjectGuid guid) const
Unit * GetUnitOwner() const
void CallScriptEffectAfterAbsorbHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount)
void CallScriptEffectManaShieldHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount, bool &defaultPrevented)
AuraObjectType GetType() const
uint8 GetStackAmount() const
ObjectGuid GetCastItemGUID() const
void SetMaxDuration(int32 duration)
void HandleAuraSpecificMods(AuraApplication const *aurApp, Unit *caster, bool apply, bool onReapply)
void SetIsSingleTarget(bool val)
virtual void _ApplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
time_t GetApplyTime() const
void CallScriptEffectAfterManaShieldHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount)
std::map< ObjectGuid, AuraApplication * > ApplicationMap
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
void CallScriptAfterDispel(DispelInfo *dispelInfo)
void _Remove(AuraRemoveMode removeMode)
bool IsSingleTarget() const
AuraMunchingQueue(Unit &owner, ObjectGuid targetGUID, int32 basePoints, uint32 spellId)
bool Execute(uint64, uint32) override
static size_t BuildChatPacket(WorldPacket &data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string_view message, uint8 chatTag, std::string const &senderName="", std::string const &receiverName="", uint32 achievementId=0, bool gmMessage=false, std::string const &channelName="")
bool Execute(uint64 e_time, uint32 p_time) override
virtual void OwnerAttackedBy(Unit *)
void OnCharmed(bool apply) override
virtual void AttackedBy(Unit *)
virtual void OnSpellClick(Unit *, bool &)
virtual void JustDied(Unit *)
virtual void MovementInform(uint32, uint32)
virtual void KilledUnit(Unit *)
virtual void EnterEvadeMode()
float GetSpellDamageMod(int32 Rank)
bool CanSwim() const override
This method check the current flag/status of a creature and its inhabit type.
bool _CanDetectFeignDeathOf(const Unit *target) const
void CallAssistance(Unit *target=nullptr)
bool IsDungeonBoss() const
uint16 GetLootMode() const
uint32 m_spells[MAX_CREATURE_SPELLS]
void SetLootRecipient(Unit *unit, bool withGroup=true)
bool CanFly() const override
bool CanCreatureAttack(Unit const *victim, bool skipDistCheck=false) const
void SetLastDamagedTime(time_t val)
bool IsEvadingAttacks() const
bool HasReactState(ReactStates state) const
bool IsValidTrainerForPlayer(Player *player, uint32 *npcFlags=nullptr) const
void SetReactState(ReactStates st)
bool HasMechanicTemplateImmunity(uint32 mask) const
bool hasLootRecipient() const
void SetPosition(float x, float y, float z, float o)
Player * GetLootRecipient() const
bool IsDamageEnoughForLootingAndReward() const
bool isTappedBy(Player const *player) const
void UpdateMovementFlags()
bool CanEnterWater() const override
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Group * GetLootRecipientGroup() const
ReactStates GetReactState() const
void UpdateMoveInLineOfSightState()
CreatureTemplate const * GetCreatureTemplate() const
void SetAssistanceTimer(uint32 value)
void SendAIReaction(AiReaction reactionType)
bool IsInEvadeMode() const
void LowerPlayerDamageReq(uint32 unDamage)
void AddSpellMod(SpellValueMod mod, int32 value)
void ResistDamage(uint32 amount)
void AbsorbDamage(uint32 amount)
void ModifyDamage(int32 amount)
SpellInfo const * GetSpellInfo() const
uint32 GetUnmitigatedDamage() const
DamageInfo(Unit *_attacker, Unit *_victim, uint32 _damage, SpellInfo const *_spellInfo, SpellSchoolMask _schoolMask, DamageEffectType _damageType, uint32 cleanDamage=0)
void BlockDamage(uint32 amount)
DamageEffectType GetDamageType() const
SpellSchoolMask GetSchoolMask() const
Unit * GetAttacker() const
uint8 GetRemovedCharges() const
uint32 GetSpellId() const
static float GetReqMoveDistSq(uint32 map_type)
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
void KillAllEvents(bool force)
uint64 CalculateTime(uint64 t_offset) const
uint64 CalculateQueueTime(uint64 delay) const
void Update(uint32 p_time)
void SetValue(FLAG_TYPE flag, T_VALUES value)
uint32 GetSpellId() const
void SetOwnerGUID(ObjectGuid owner)
ObjectGuid GetOwnerGUID() const
void SetRespawnTime(int32 respawn)
bool IsStaticTransport() const
bool HasGlobalCooldown(SpellInfo const *spellInfo) const
GlobalCooldownList m_GlobalCooldowns
void AddGlobalCooldown(SpellInfo const *spellInfo, uint32 gcd)
void CancelGlobalCooldown(SpellInfo const *spellInfo)
uint8 GetMemberGroup(ObjectGuid guid) const
void BroadcastPacket(WorldPacket *packet, bool ignorePlayersInBGRaid, int group=-1, ObjectGuid ignore=ObjectGuid::Empty)
GroupReference * GetFirstMember()
uint32 GetMembersCount() const
ObjectGuid GetLooterGuid() const
LootMethod GetLootMethod() const
void UpdateLooterGuid(WorldObject *pLootedObject, bool ifneed=false)
void SendLooter(Creature *creature, Player *pLooter)
bool InitStatsForLevel(uint8 level)
SpellInfo const * GetSpellInfo() const
void SetHeal(uint32 amount)
void AbsorbHeal(uint32 amount)
void deleteReferences(bool removeFromMap=false)
void setOnlineOfflineState(bool isOnline)
void threatAssist(Unit *victim, float baseThreat, SpellInfo const *threatSpell=nullptr)
HostileReference * getFirst()
void deleteReferencesForFaction(uint32 faction)
ObjectGuid getUnitGuid() const
HostileReference * next()
void PermBindAllPlayers()
uint32 GetEnchantmentId(EnchantmentSlot slot) const
ItemTemplate const * GetTemplate() const
void PlayerRelocation(Player *, float x, float y, float z, float o)
uint8 GetSpawnMode() const
std::unordered_set< Unit * > i_objectsForDelayedVisibility
InstanceMap * ToInstanceMap()
void CreatureRelocation(Creature *creature, float x, float y, float z, float o)
BattlegroundMap * ToBattlegroundMap()
bool IsRaidOrHeroicDungeon() const
bool IsBattleArena() const
bool IsGuardianPet() const
void setDeathState(DeathState s, bool despawn=false) override
void UpdateMotion(uint32 diff)
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
MovementGeneratorType GetCurrentMovementGeneratorType() const
void ReinitializeMovement()
void MovementExpiredOnSlot(MovementSlot slot, bool reset=true)
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ)
void MovementExpired(bool reset=true)
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=0)
uint32 GetCurrentSplineId() const
void MoveJumpTo(float angle, float speedXY, float speedZ)
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
void Clear(bool reset=true)
void MoveFleeing(Unit *enemy, uint32 time=0)
Location ComputePosition() const
Vector3 FinalDestination() const
int32 currentPathIdx() const
uint8 GetAnimationType() const
void updateState(int32 difftime, UpdateHandler &handler)
bool HasAnimation() const
void DisableTransportPathTransformations()
void MoveTo(const Vector3 &destination, bool generatePath=false, bool forceDestination=false)
void SetVelocity(float velocity)
void SetFacing(float angle)
PackedGuid WriteAsPacked() const
static ObjectGuid const Empty
std::string ToString() const
void ApplyModSignedFloatValue(uint16 index, float val, bool apply)
uint8 GetByteValue(uint16 index, uint8 offset) const
void SetByteValue(uint16 index, uint8 offset, uint8 value)
int32 GetInt32Value(uint16 index) const
float GetObjectScale() const
uint32 GetUInt32Value(uint16 index) const
bool AddGuidValue(uint16 index, ObjectGuid value)
void RemoveFieldNotifyFlag(uint16 flag)
void SetFlag(uint16 index, uint32 newFlag)
void RemoveFlag(uint16 index, uint32 oldFlag)
float GetFloatValue(uint16 index) const
void SetGuidValue(uint16 index, ObjectGuid value)
void BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) const
bool RemoveGuidValue(uint16 index, ObjectGuid value)
bool HasFlag(uint16 index, uint32 flag) const
static ObjectGuid GetGUID(Object const *o)
PackedGuid const & GetPackGUID() const
bool HasByteFlag(uint16 index, uint8 offset, uint8 flag) const
void SetFieldNotifyFlag(uint16 flag)
void SetUInt32Value(uint16 index, uint32 value)
ObjectGuid GetGUID() const
void ApplyPercentModFloatValue(uint16 index, float val, bool apply)
void SetStatInt32Value(uint16 index, int32 value)
uint32 GetAura(uint32 petEntry) const
bool CreateBaseAtCreatureInfo(CreatureTemplate const *cinfo, Unit *owner)
bool CreateBaseAtCreature(Creature *creature)
bool isControlled() const
void InitPetCreateSpells()
void SetAuraUpdateMaskForRaid(uint8 slot)
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
ReputationMgr & GetReputationMgr()
static TeamId TeamIdForRace(uint8 race)
void SetSpellModTakingSpell(Spell *spell, bool apply)
bool IsBaseRuneSlotsOnCooldown(RuneType runeType) const
bool NeedSendSpectatorData() const
void SendAttackSwingCancelAttack()
bool IsInSameRaidWith(Player const *p) const
PlayerSpellMap const & GetSpellMap() const
bool HasItemFitToSpellRequirements(SpellInfo const *spellInfo, Item const *ignoreItem=nullptr) const
WorldSession * GetSession() const
void SendRemoveControlBar()
void SetGroupUpdateFlag(uint32 flag)
void DuelComplete(DuelCompleteType type)
void RestoreSpellMods(Spell *spell, uint32 ownerAuraId=0, Aura *aura=nullptr)
uint16 GetSkillValue(uint32 skill) const
void CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 procVictim, uint32 procEx)
void SendAutoRepeatCancel(Unit *target)
void UpdatePvP(bool state, bool _override=false)
uint8 m_forced_speed_changes[MAX_MOVE_TYPE]
float GetRatingBonusValue(CombatRating cr) const
void SendDirectMessage(WorldPacket *data)
void CharmSpellInitialize()
void UpdateCombatSkills(Unit *victim, WeaponAttackType attType, bool defence, Item *item=nullptr)
uint32 GetBaseSpellPowerBonus()
bool HaveAtClient(WorldObject const *u) const
bool InBattleground() const
void DurabilityPointLossForEquipSlot(EquipmentSlots slot)
TeamId GetTeamId(bool original=false) const
bool SetCanFly(bool apply, bool packetOnly=false) override
void PetSpellInitialize()
Item * GetUseableItemByPos(uint8 bag, uint8 slot) const
void SetFallInformation(uint32 time, float z)
uint8 GetComboPoints() const
Battleground * GetBattleground(bool create=false) const
uint32 GetResurrectionSpellId()
bool GetCommandStatus(uint32 command) const
OutdoorPvP * GetOutdoorPvP() const
bool HasSpellCooldown(uint32 spell_id) const override
int32 GetSpellPenetrationItemMod() const
uint16 GetMaxSkillValue(uint32 skill) const
void RewardPlayerAndGroupAtKill(Unit *victim, bool isBattleGround)
void AddSpellAndCategoryCooldowns(SpellInfo const *spellInfo, uint32 itemId, Spell *spell=nullptr, bool infinityCooldown=false)
void AddComboPoints(Unit *target, int8 count)
void RemoveCategoryCooldown(uint32 cat)
void AddSpellCooldown(uint32 spell_id, uint32 itemid, uint32 end_time, bool needSendToClient=false, bool forceSendToSpectator=false) override
bool IsGameMaster() const
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0, Unit *target=nullptr, bool newInstance=false)
SpellCooldowns GetSpellCooldowns() const
static uint8 GetAttackBySlot(uint8 slot)
void PossessSpellInitialize()
void StopCastingBindSight()
void SendMessageToSet(WorldPacket *data, bool self) override
void SetClientControl(Unit *target, bool allowMove, bool packetOnly=false)
ReputationRank GetReputationRank(uint32 faction_id) const
Unit * GetSelectedUnit() const
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
bool isHonorOrXPTarget(Unit *victim) const
float GetRealDodge() const
uint8 GetSubGroup() const
void VehicleSpellInitialize()
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
void Say(std::string_view text, Language language, WorldObject const *=nullptr) override
Handles said message in regular chat based on declared language and in config pre-defined Range.
void SetFactionForRace(uint8 race)
bool isAllowedToLoot(const Creature *creature)
Item * GetItemByGuid(ObjectGuid guid) const
void ResummonPetTemporaryUnSummonedIfAny()
ObjectGuid GetComboTarget() const
bool CanSeeSpellClickOn(Creature const *creature) const
void SetContestedPvPTimer(uint32 newTime)
Spell * m_spellModTakingSpell
uint32 GetDelayedOperations() const
void SendCooldownEvent(SpellInfo const *spellInfo, uint32 itemId=0, Spell *spell=nullptr, bool setCooldown=true)
bool IsInSameGroupWith(Player const *p) const
std::set< Unit * > m_isInSharedVisionOf
void SetProcCooldown(uint32 cooldown)
SpellInfo const * GetTriggerAuraSpell() const
ProcEventInfo(Unit *actor, Unit *actionTarget, Unit *procTarget, uint32 typeMask, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell const *spell, DamageInfo *damageInfo, HealInfo *healInfo, SpellInfo const *triggeredByAuraSpell=nullptr, int8 procAuraEffectIndex=-1)
SpellInfo const * GetSpellInfo() const
Unit * GetActionTarget() const
Unit * GetProcTarget() const
ObjectGuid _auraOwnerGUID
bool Execute(uint64 e_time, uint32 p_time) override
FactionState const * GetState(FactionEntry const *factionEntry) const
ReputationRank const * GetForcedRankIfAny(FactionTemplateEntry const *factionTemplateEntry) const
bool IsAtWar(uint32 faction_id) const
void SetPointedTo(Unit *u)
void SetDst(float x, float y, float z, float orientation, uint32 mapId=MAPID_INVALID)
void SetGOTarget(GameObject *target)
void SetUnitTarget(Unit *target)
void cast(bool skipCheck=false)
SpellCastResult prepare(SpellCastTargets const *targets, AuraEffect const *triggeredByAura=nullptr)
void SetSpellValue(SpellValueMod mod, int32 value)
bool IsInterruptable() const
void SetExecutedCurrently(bool yes)
void SendChannelUpdate(uint32 time)
void SendInterrupted(uint8 result)
SpellInfo const * m_spellInfo
int32 GetCastTime() const
void cancel(bool bySelf=false)
CurrentSpellTypes GetCurrentContainer() const
SpellCastResult CheckCast(bool strict)
SpellInfo const * GetSpellInfo() const
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE)
void SetReferencedFromCurrent(bool yes)
void finish(bool ok=true)
bool IsRankOf(SpellInfo const *spellInfo) const
uint32 GetMaxTicks() const
uint32 GetEffectMechanicMask(uint8 effIndex) const
SpellInfo const * GetFirstRankSpell() const
bool IsAutocastable() const
uint32 GetCategory() const
bool IsRequiringDeadTarget() const
bool ValidateAttribute6SpellDamageMods(const Unit *caster, const AuraEffect *auraEffect, bool isDot) const
bool IsDeathPersistent() const
bool IsCooldownStartedOnEvent() const
SpellRangeEntry const * RangeEntry
uint32 GetDispelMask() const
SpellSpecificType GetSpellSpecific() const
bool IsMultiSlotAura() const
float GetMinRange(bool positive=false) const
int32 GetMaxDuration() const
std::array< uint32, 2 > SpellVisual
bool CanPierceImmuneAura(SpellInfo const *aura) const
uint32 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const
bool IsAllowingDeadTarget() const
Mechanics GetEffectMechanic(uint8 effIndex) const
SpellSchoolMask GetSchoolMask() const
AuraStateType GetAuraState() const
bool HasAttribute(SpellAttr0 attribute) const
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
int32 GetDuration() const
uint32 ManaCostPercentage
int32 EquippedItemSubClassMask
float GetMaxRange(bool positive=false, Unit *caster=nullptr, Spell *spell=nullptr) const
bool IsCritCapable() const
uint32 GetAllEffectsMechanicMask() const
bool NeedsExplicitUnitTarget() const
SpellCastResult CheckTarget(Unit const *caster, WorldObject const *target, bool implicit=true) const
int32 CalcPowerCost(Unit const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
uint32 CalcCastTime(Unit *caster=nullptr, Spell *spell=nullptr) const
bool HasEffect(SpellEffects effect) const
bool IsAffectingArea() const
bool IsRangedWeaponSpell() const
bool HasAura(AuraType aura) const
uint32 StartRecoveryCategory
uint32 AuraInterruptFlags
bool IsPositiveEffect(uint8 effIndex) const
bool IsSingleTarget() const
SpellCastResult CheckExplicitTarget(Unit const *caster, WorldObject const *target, Item const *itemTarget=nullptr) const
SplineHandler(Unit *unit)
bool operator()(Movement::MoveSpline::UpdateResult result)
virtual void UnSummon(uint32 msTime=0)
const SummonPropertiesEntry *const m_Properties
std::list< HostileReference * > StorageType
void addThreat(Unit *victim, float threat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
ThreatContainer::StorageType const & getThreatList() const
ThreatContainer::StorageType const & getOfflineThreatList() const
void modifyThreatPercent(Unit *victim, int32 percent)
bool isThreatListEmpty() const
StorageType::const_iterator const_iterator
const_iterator begin() const
uint32 GetSpell(uint8 slot=0) const
virtual void RemovePassenger(WorldObject *passenger, bool withAll=false)=0
virtual void HealReceived(Unit *, uint32 &)
virtual void DamageTaken(Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
virtual void HealDone(Unit *, uint32 &)
virtual void DamageDealt(Unit *, uint32 &, DamageEffectType)
virtual void AttackStart(Unit *)
bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
float GetSpellCritChanceReduction() const
void EnterVehicle(Unit *base, int8 seatId=-1)
int32 ModifyHealth(int32 val)
uint32 m_reactiveTimer[MAX_REACTIVE]
void ClearUnitState(uint32 f)
void OutDebugInfo() const
bool HasNegativeAuraWithAttribute(uint32 flag, ObjectGuid guid=ObjectGuid::Empty)
void SetMinion(Minion *minion, bool apply)
std::pair< AuraApplicationMap::iterator, AuraApplicationMap::iterator > AuraApplicationMapBoundsNonConst
bool IsUnderLastManaUseEffect() const
bool _IsValidAssistTarget(Unit const *target, SpellInfo const *bySpell) const
bool m_duringRemoveFromWorld
virtual void ProcessTerrainStatusUpdate()
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, bool bySelf=false)
uint32 GetCreatePowers(Powers power) const
bool HandleAuraRaidProcFromChargeWithValue(AuraEffect *triggeredByAura)
virtual bool IsMovementPreventedByCasting() const
bool HealthAbovePct(int32 pct) const
void RemoveGameObject(GameObject *gameObj, bool del)
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect *except=nullptr) const
int32 GetMechanicResistChance(const SpellInfo *spell)
static void ApplyResilience(const Unit *victim, float *crit, int32 *damage, bool isCrit, CombatRating type)
Spell * m_currentSpells[CURRENT_MAX_SPELL]
float GetHealthPct() const
void ProcDamageAndSpellFor(bool isVictim, Unit *target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const *procSpellInfo, uint32 damage, SpellInfo const *procAura=nullptr, int8 procAuraEffectIndex=-1, Spell const *procSpell=nullptr, DamageInfo *damageInfo=nullptr, HealInfo *healInfo=nullptr)
static float GetEffectiveResistChance(Unit const *owner, SpellSchoolMask schoolMask, Unit const *victim, SpellInfo const *spellInfo=nullptr)
DiminishingLevels GetDiminishing(DiminishingGroup group)
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, float TotalMod=0.0f, uint32 stack=1)
virtual void setDeathState(DeathState s, bool despawn=false)
void _RemoveNoStackAurasDueToAura(Aura *aura)
void AddPointedBy(SafeUnitPointer *sup)
void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 TransitTime, SplineFlags sf=SPLINEFLAG_WALK_MODE)
uint32 GetUnitMovementFlags() const
LiquidTypeEntry const * _lastLiquid
bool HasAuraTypeWithValue(AuraType auratype, int32 value) const
void RemovePetAura(PetAura const *petSpell)
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
uint32 GetUnitMeleeSkill(Unit const *target=nullptr) const
void _UpdateAutoRepeatSpell()
void IncrDiminishing(DiminishingGroup group)
float GetRangedCritChanceReduction() const
float GetTotalAuraModValue(UnitMods unitMod) const
void RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, ObjectGuid casterGUID)
void SetFacingTo(float ori)
Unit * GetRedirectThreatTarget() const
static uint32 DealDamage(Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true, bool allowGM=false)
bool CanHaveThreatList() const
Movement::MoveSpline * movespline
void RemoveAurasByShapeShift()
uint32 GetCombatTimer() const
void CombatStop(bool includingCast=false)
void RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveMode removemode=AURA_REMOVE_BY_DEFAULT, uint32 except=0)
float SpellTakenCritChance(Unit const *caster, SpellInfo const *spellProto, SpellSchoolMask schoolMask, float doneChance, WeaponAttackType attackType, bool skipEffectCheck) const
ReputationRank GetReactionTo(Unit const *target) const
void NearTeleportTo(float x, float y, float z, float orientation, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
bool IsCreatedByPlayer() const
bool IsValidAttackTarget(Unit const *target) const
bool HasVisibleAuraType(AuraType auraType) const
float GetSpeed(UnitMoveType mtype) const
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
void _UnregisterDynObject(DynamicObject *dynObj)
Aura * GetAuraOfRankedSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
bool HasNegativeAuraWithInterruptFlag(uint32 flag, ObjectGuid guid=ObjectGuid::Empty)
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void AddInterruptMask(uint32 mask)
int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask)
void SetMinionGUID(ObjectGuid guid)
void EnergizeBySpell(Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
Diminishing m_Diminishing
virtual bool HasSpellCooldown(uint32) const
float SpellDoneCritChance(Unit const *, SpellInfo const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType, bool skipEffectCheck) const
void UpdateHeight(float newZ)
Only server-side height update, does not broadcast to client.
bool IsPetAura(Aura const *aura)
ComboPointHolderSet m_ComboPointHolders
void SetConfused(bool apply)
void _UpdateSpells(uint32 time)
void AddToWorld() override
void SetFaction(uint32 faction)
AttackerSet const & getAttackers() const
FactionTemplateEntry const * GetFactionTemplateEntry() const
void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
float GetTotalAttackPowerValue(WeaponAttackType attType, Unit *pVictim=nullptr) const
bool GetMeleeAttackPoint(Unit *attacker, Position &pos)
virtual void Say(std::string_view text, Language language, WorldObject const *target=nullptr)
bool HasBreakableByDamageCrowdControlAura(Unit *excludeCasterChannel=nullptr) const
void DelayOwnedAuras(uint32 spellId, ObjectGuid caster, int32 delaytime)
VisibleAuraMap const * GetVisibleAuras()
void SetControlled(bool apply, UnitState state)
bool IsImmunedToSchool(SpellSchoolMask meleeSchoolMask) const
SpellSchools GetSpellSchoolByAuraGroup(UnitMods unitMod) const
void SetStunned(bool apply)
uint32 GetModelForForm(ShapeshiftForm form) const
Stats GetStatByAuraGroup(UnitMods unitMod) const
float m_auraModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_END]
std::list< Aura * > AuraList
uint32 GetResistance(SpellSchools school) const
int32 m_attackTimer[MAX_ATTACK]
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0)
void AddPetAura(PetAura const *petSpell)
float m_modAttackSpeedPct[3]
Player * GetSpellModOwner() const
Spell * FindCurrentSpellBySpellId(uint32 spell_id) const
int32 GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
DeathState getDeathState()
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
Creature * GetVehicleCreatureBase() const
float GetCollisionHeight() const override
Return collision height sent to client.
bool IsTriggeredAtSpellProcEvent(Unit *victim, Aura *aura, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const *&spellProcEvent, ProcEventInfo const &eventInfo)
void CombatStartOnCast(Unit *target, bool initialAggro=true, uint32 duration=0)
void RemoveAllGameObjects()
int32 CalculateSpellDamage(Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=nullptr) const
virtual bool IsImmunedToSpell(SpellInfo const *spellInfo)
bool isSpellBlocked(Unit *victim, SpellInfo const *spellProto, WeaponAttackType attackType=BASE_ATTACK)
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Unit * getAttackerForHelper() const
float GetSpellMinRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
void _RegisterDynObject(DynamicObject *dynObj)
bool isInFrontInMap(Unit const *target, float distance, float arc=M_PI) const
uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto=nullptr)
bool IsPolymorphed() const
float GetUnitDodgeChance() const
bool HandleDummyAuraProc(Unit *victim, uint32 damage, AuraEffect *triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
Vehicle * GetVehicle() const
float m_weaponDamage[MAX_ATTACK][2]
ShapeshiftForm GetShapeshiftForm() const
void ProcDamageAndSpell(Unit *victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType=BASE_ATTACK, SpellInfo const *procSpellInfo=nullptr, SpellInfo const *procAura=nullptr, int8 procAuraEffectIndex=-1, Spell const *procSpell=nullptr, DamageInfo *damageInfo=nullptr, HealInfo *healInfo=nullptr)
Unit * SelectNearbyTarget(Unit *exclude=nullptr, float dist=NOMINAL_MELEE_RANGE) const
float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL)
SpellMissInfo MagicSpellHitResult(Unit *victim, SpellInfo const *spell)
float CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const
float GetCombatRatingReduction(CombatRating cr) const
void SendSpellNonMeleeReflectLog(SpellNonMeleeDamage *log, Unit *attacker)
AuraApplication * GetAuraApplication(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraApplication *except=nullptr) const
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
virtual void UpdateAttackPowerAndDamage(bool ranged=false)=0
static void CalcHealAbsorb(HealInfo &healInfo)
virtual void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float &minDamage, float &maxDamage)=0
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
virtual void Yell(std::string_view text, Language language, WorldObject const *target=nullptr)
uint32 GetDiseasesByCaster(ObjectGuid casterGUID, uint8 mode=0)
void HandleProcExtraAttackFor(Unit *victim)
bool HandleAuraProc(Unit *victim, uint32 damage, Aura *triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool *handled)
virtual bool HasSpellItemCooldown(uint32, uint32) const
static uint32 CalcArmorReducedDamage(Unit const *attacker, Unit const *victim, const uint32 damage, SpellInfo const *spellInfo, uint8 attackerLevel=0, WeaponAttackType attackType=MAX_ATTACK)
void SetCantProc(bool apply)
Unit * GetCharmer() const
void PetSpellFail(const SpellInfo *spellInfo, Unit *target, uint32 result)
Pet * CreateTamedPetFrom(Creature *creatureTarget, uint32 spell_id=0)
bool IsHostileToPlayers() const
float GetCollisionRadius() const override
this method gets the radius of a Unit by DB if any value is defined, otherwise it gets the value by t...
uint32 GetDefenseSkillValue(Unit const *target=nullptr) const
void SetContestedPvP(Player *attackedPlayer=nullptr, bool lookForNearContestedGuards=true)
void SendSpellDamageImmune(Unit *target, uint32 spellId)
void _removeAttacker(Unit *pAttacker)
void SendAttackStateUpdate(CalcDamageInfo *damageInfo)
void RemoveAppliedAuras(std::function< bool(AuraApplication const *)> const &check)
void CastPetAura(PetAura const *aura)
void RemoveAllAurasExceptType(AuraType type)
DynamicObject * GetDynObject(uint32 spellId)
int32 CalcSpellDuration(SpellInfo const *spellProto)
MotionMaster * i_motionMaster
virtual bool CanFly() const =0
void SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
Unit * GetVehicleBase() const
bool haveOffhandWeapon() const
void _addAttacker(Unit *pAttacker)
void EnterVehicleUnattackable(Unit *base, int8 seatId=-1)
void SetCharm(Unit *target, bool apply)
void SendTeleportPacket(Position &pos)
MeleeHitOutcome RollMeleeOutcomeAgainst(const Unit *victim, WeaponAttackType attType) const
float ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit *caster, DiminishingLevels Level, int32 limitduration)
uint8 getLevelForTarget(WorldObject const *) const override
float GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const
bool CanDualWield() const
void SetModelVisible(bool on)
int32 CalculateAOEDamageReduction(int32 damage, uint32 schoolMask, Unit *caster) const
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
void UpdateInterruptMask()
void setAttackTimer(WeaponAttackType type, int32 time)
void StartReactiveTimer(ReactiveType reactive)
void CleanupsBeforeDelete(bool finalCleanup=true) override
uint32 GetMaxHealth() const
Aura * AddAura(uint32 spellId, Unit *target)
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
void TauntApply(Unit *victim)
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
bool isAttackingPlayer() const
ObjectGuid m_ObjectSlot[MAX_GAMEOBJECT_SLOT]
float GetTotalStatValue(Stats stat, float additionalValue=0.0f) const
virtual void UpdateResistances(uint32 school)=0
void SetInCombatWith(Unit *enemy, uint32 duration=0)
void SetFacingToObject(WorldObject *object)
void UpdateSplineMovement(uint32 t_diff)
bool IsLevitating() const
uint32 GetSpellCritDamageReduction(uint32 damage) const
RedirectThreatInfo _redirectThreatInfo
void ExecuteDelayedUnitRelocationEvent()
float GetMeleeCritChanceReduction() const
void SendMovementHover(Player *sendTo)
void CombatStart(Unit *target, bool initialAggro=true)
bool IsInSanctuary() const
std::pair< AuraMap::const_iterator, AuraMap::const_iterator > AuraMapBounds
uint32 GetRangedDamageReduction(uint32 damage) const
bool HandleOverrideClassScriptAuraProc(Unit *victim, uint32 damage, AuraEffect *triggeredByAura, SpellInfo const *procSpell, uint32 cooldown)
int32 ModSpellDuration(SpellInfo const *spellProto, Unit const *target, int32 duration, bool positive, uint32 effectMask)
float m_createStats[MAX_STATS]
void UpdateObjectVisibility(bool forced=true, bool fromUpdate=false) override
bool HasAuraWithMechanic(uint32 mechanicMask) const
float ApplyEffectModifiers(SpellInfo const *spellProto, uint8 effect_index, float value) const
virtual void AddSpellCooldown(uint32, uint32, uint32, bool needSendToClient=false, bool forceSendToSpectator=false)
bool HandleProcTriggerSpell(Unit *victim, uint32 damage, AuraEffect *triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
void RemoveAllAurasRequiringDeadTarget()
void UpdateReactives(uint32 p_time)
bool CanApplyResilience() const
AuraEffect * IsScriptOverriden(SpellInfo const *spell, int32 script) const
float m_modRangedHitChance
float GetCombatReach() const override
void ExecuteDelayedUnitAINotifyEvent()
uint8 getRace(bool original=false) const
bool IsOnVehicle(const Unit *vehicle) const
void ApplyStatPercentBuffMod(Stats stat, float val, bool apply)
AuraApplicationMap & GetAppliedAuras()
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
float GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
void StopMoving()
-------—End of Pet responses methods-------—
std::pair< AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator > AuraApplicationMapBounds
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
void AddPlayerToVision(Player *player)
bool HasAuraTypeWithCaster(AuraType auratype, ObjectGuid caster) const
void RewardRage(uint32 damage, uint32 weaponSpeedHitFactor, bool attacker)
GameObject * GetGameObject(uint32 spellId) const
bool IsWithinCombatRange(const Unit *obj, float dist2compare) const
float processDummyAuras(float TakenTotalMod) const
void SendPlaySpellVisual(uint32 id)
void _ExitVehicle(Position const *exitPosition=nullptr)
uint32 m_removedAurasCount
uint32 GetRangedCritDamageReduction(uint32 damage) const
void RemoveAllAurasOnDeath()
void SetHealth(uint32 val)
void SetInCombatState(bool PvP, Unit *enemy=nullptr, uint32 duration=0)
bool IsStandState() const
void SetMaxPower(Powers power, uint32 val)
ReputationRank GetFactionReactionTo(FactionTemplateEntry const *factionTemplateEntry, Unit const *target) const
bool HasStealthAura() const
uint32 GetFaction() const
void RemoveNotOwnSingleTargetAuras()
bool IsInCombatWith(Unit const *who) const
bool IsPetInCombat() const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
AuraMap::iterator m_auraUpdateIterator
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Unit * GetMeleeHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo=nullptr)
std::map< uint8, AuraApplication * > VisibleAuraMap
void RemoveAurasWithAttribute(uint32 flags)
bool m_AutoRepeatFirstCast
uint16 m_delayed_unit_ai_notify_timer
void TauntFadeOut(Unit *taunter)
void _DeleteRemovedAuras()
bool HandleAuraRaidProcFromCharge(AuraEffect *triggeredByAura)
int32 ModifyPower(Powers power, int32 val)
Unit * GetNextRandomRaidMemberOrPet(float radius)
static int32 DealHeal(Unit *healer, Unit *victim, uint32 addhealth)
Powers GetPowerTypeByAuraGroup(UnitMods unitMod) const
bool IsNeutralToAll() const
void SendMovementWaterWalking(Player *sendTo)
AuraEffect * GetAuraEffectDummy(uint32 spellid) const
void CastStop(uint32 except_spellid=0, bool withInstant=true)
std::pair< AuraStateAurasMap::const_iterator, AuraStateAurasMap::const_iterator > AuraStateAurasMapBounds
float GetUnitMissChance(WeaponAttackType attType) const
void AddUnitState(uint32 f)
void ClearComboPointHolders()
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
bool bRequestForcedVisibilityUpdate
void MonsterMoveWithSpeed(float x, float y, float z, float speed)
void SendSpellDamageResist(Unit *target, uint32 spellId)
void SendPetActionFeedback(uint8 msg)
-------—Pet responses methods--------------—
bool isInAccessiblePlaceFor(Creature const *c) const
void DisableRotate(bool apply)
uint32 GetModelForTotem(PlayerTotemType totemType)
uint32 BuildAuraStateUpdateForTarget(Unit *target) const
bool IsDuringRemoveFromWorld() const
float GetSpellMaxRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
int32 GetMaxPositiveAuraModifier(AuraType auratype)
bool m_ControlledByPlayer
void SetFeared(bool apply)
Unit * GetCharmerOrOwner() const
int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
void RemoveAurasDueToItemSpell(uint32 spellId, ObjectGuid castItemGuid)
virtual void UpdateDamagePhysical(WeaponAttackType attType)
void CalculateMeleeDamage(Unit *victim, uint32 damage, CalcDamageInfo *damageInfo, WeaponAttackType attackType=BASE_ATTACK, const bool sittingVictim=false)
void _ApplyAllAuraStatMods()
HostileRefMgr & getHostileRefMgr()
void propagateSpeedChange()
-------—End of Pet responses methods-------—
virtual bool SetHover(bool enable, bool packetOnly=false)
uint32 GetCreatureType() const
bool GetRandomContactPoint(const Unit *target, float &x, float &y, float &z, bool force=false) const
void AddGameObject(GameObject *gameObj)
bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
void SetLevel(uint8 lvl, bool showLevelChange=true)
void SetCurrentCastedSpell(Spell *pSpell)
virtual bool SetSwim(bool enable)
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const *target=nullptr) const
std::unordered_set< Unit * > AttackerSet
uint32 GetPhaseByAuras() const
Aura * GetOwnedAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, Aura *except=nullptr) const
AuraList & GetSingleCastAuras()
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
int32 GetHealthGain(int32 dVal)
virtual bool SetCanFly(bool enable, bool packetOnly=false)
AuraApplicationList m_interruptableAuras
uint32 m_last_notify_mstime
SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY]
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spell, bool canReflect=false)
void SendTameFailure(uint8 result)
void ModifyAuraState(AuraStateType flag, bool apply)
bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const
uint32 GetAuraCount(uint32 spellId) const
bool isInBackInMap(Unit const *target, float distance, float arc=M_PI) const
static uint32 SpellCriticalDamageBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
uint32 GetNativeDisplayId() const
float MeleeSpellMissChance(const Unit *victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const
uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct)
virtual void UpdateArmor()=0
bool HealthBelowPct(int32 pct) const
void SetRooted(bool apply)
void AddUnitMovementFlag(uint32 f)
float GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) const
uint32 _oldFactionId
faction before charm
bool Attack(Unit *victim, bool meleeAttack)
float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type) const
uint32 SpellDamageBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1)
AuraEffect * GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const
SafeUnitPointer m_movedByPlayer
void UpdateAuraForGroup(uint8 slot)
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
void JumpTo(float speedXY, float speedZ, bool forward=true)
ObjectGuid GetMinionGUID() const
uint16 GetMaxSkillValueForLevel(Unit const *target=nullptr) const
void SendRemoveFromThreatListOpcode(HostileReference *pHostileReference)
int32 m_baseSpellCritChance
bool HasUnitMovementFlag(uint32 f) const
AuraApplication * _CreateAuraApplication(Aura *aura, uint8 effMask)
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, ObjectGuid casterGUID, Unit *dispeller, uint8 chargesRemoved=1)
int32 GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
uint32 GetMaxPower(Powers power) const
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr)
virtual void UpdateMaxPower(Powers power)=0
void RemoveOwnedAuras(std::function< bool(Aura const *)> const &check)
void _AddAura(UnitAura *aura, Unit *caster)
virtual bool IsInWater() const
TransportBase * GetDirectTransport() const
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
virtual void TextEmote(std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
uint32 GetCreateHealth() const
void SendMovementFlagUpdate(bool self=false)
void RemoveDynObject(uint32 spellId)
void UnsummonAllTotems(bool onDeath=false)
bool HasAuraState(AuraStateType flag, SpellInfo const *spellProto=nullptr, Unit const *Caster=nullptr) const
AuraEffect * GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
virtual bool SetFeatherFall(bool enable, bool packetOnly=false)
void SendPlaySpellImpact(ObjectGuid guid, uint32 id)
SharedVisionList const & GetSharedVisionList()
float GetTotalAuraMultiplier(AuraType auratype) const
std::multimap< uint32, Aura * > AuraMap
virtual uint32 GetShieldBlockValue() const =0
void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void SetPower(Powers power, uint32 val)
void SendPetTalk(uint32 pettalk)
bool HasAuraType(AuraType auraType) const
std::set< SafeUnitPointer * > SafeUnitPointerSet
virtual bool SetWalk(bool enable)
SpellMissInfo MeleeSpellHitResult(Unit *victim, SpellInfo const *spell)
Aura * _TryStackingOrRefreshingExistingAura(SpellInfo const *newAura, uint8 effMask, Unit *caster, int32 *baseAmount=nullptr, Item *castItem=nullptr, ObjectGuid casterGUID=ObjectGuid::Empty, bool periodicReset=false)
virtual bool UpdateStats(Stats stat)=0
void BuildCooldownPacket(WorldPacket &data, uint8 flags, uint32 spellId, uint32 cooldown)
void SendHealSpellLog(Unit *victim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical=false)
void RemoveAllDynObjects()
float m_modMeleeHitChance
void _RemoveAllAuraStatMods()
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
void SetPhaseMask(uint32 newPhaseMask, bool update) override
uint32 GetAttackTime(WeaponAttackType att) const
ObjectGuid GetCritterGUID() const
uint16 GetExtraUnitMovementFlags() const
Unit * GetMagicHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo)
AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraApplication *except=nullptr) const
TempSummon * ToTempSummon()
ObjectGuid GetCharmGUID() const
void StopAttackFaction(uint32 faction_id)
uint32 GetCastingTimeForBonus(SpellInfo const *spellProto, DamageEffectType damagetype, uint32 CastingTime) const
void RemoveAreaAurasDueToLeaveWorld()
static uint32 SpellCriticalHealingBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
bool CanModifyStats() const
void BuildMovementPacket(ByteBuffer *data) const
void RemoveCharmedBy(Unit *charmer)
bool CreateVehicleKit(uint32 id, uint32 creatureEntry)
int32 ModifyPowerPct(Powers power, float pct, bool apply=true)
bool IsWithinRange(Unit const *obj, float dist) const
void _ApplyAura(AuraApplication *aurApp, uint8 effMask)
virtual void SetDisplayId(uint32 modelId)
void SendPetAIReaction(ObjectGuid guid)
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
virtual float GetFollowAngle() const
void CleanupBeforeRemoveFromMap(bool finalCleanup)
uint8 getStandState() const
Position m_last_notify_position
MotionMaster * GetMotionMaster()
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
float GetCollisionWidth() const override
this method gets the diameter of a Unit by DB if any value is defined, otherwise it gets the value by...
int32 SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask, bool isDoT=false)
float GetAPMultiplier(WeaponAttackType attType, bool normalized)
void UpdateOrientation(float orientation)
Only server-side orientation update, does not broadcast to client.
uint32 GetMeleeCritDamageReduction(uint32 damage) const
virtual bool IsUnderWater() const
void SendEnergizeSpellLog(Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
void StopMovingOnCurrentPos()
float GetUnitBlockChance() const
void RemovePlayerFromVision(Player *player)
CharmThreatMap _charmThreatInfo
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
float GetCreateStat(Stats stat) const
void UpdateSplinePosition()
void SetOwnerGUID(ObjectGuid owner)
CharmInfo * GetCharmInfo()
float SpellPctHealingModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
Unit * GetFirstControlled() const
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
ObjectGuid GetTransGUID() const override
void ApplyCastTimePercentMod(float val, bool apply)
Vehicle * GetVehicleKit() const
void DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
virtual bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, uint32 index) const
bool HasUnitState(const uint32 f) const
Player * GetAffectingPlayer() const
uint32 GetSpellDamageReduction(uint32 damage) const
float SpellPctDamageModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
void FinishSpell(CurrentSpellTypes spellType, bool ok=true)
void Update(uint32 time) override
void ModSpellCastTime(SpellInfo const *spellProto, int32 &castTime, Spell *spell=nullptr)
bool IsInRaidWith(Unit const *unit) const
void ProcessPositionDataChanged(PositionFullTerrainStatus const &data) override
bool IsInFeralForm() const
void SendMeleeAttackStart(Unit *victim, Player *sendTo=nullptr)
uint32 MeleeDamageBonusTaken(Unit *attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const *spellProto=nullptr)
void BuildHeartBeatMsg(WorldPacket *data) const
HostileRefMgr m_HostileRefMgr
bool IsFriendlyTo(Unit const *unit) const
std::pair< AuraMap::iterator, AuraMap::iterator > AuraMapBoundsNonConst
void RemoveUnitMovementFlag(uint32 f)
void RemoveBindSightAuras()
int32 GetMaxNegativeAuraModifier(AuraType auratype) const
AuraApplicationMap m_appliedAuras
int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
CharmInfo * InitCharmInfo()
ObjectGuid GetOwnerGUID() const
void RemoveAllAttackers()
virtual bool CanSwim() const
this method checks the current flag of a unit
uint32 GetDoTsByCaster(ObjectGuid casterGUID) const
bool IsControllableGuardian() const
void RemoveFromWorld() override
bool IsWithinMeleeRange(const Unit *obj, float dist=0.f) const
int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask)
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false)
Unit * SelectNearbyNoTotemTarget(Unit *exclude=nullptr, float dist=NOMINAL_MELEE_RANGE) const
virtual void UpdateMaxHealth()=0
uint32 HasUnitTypeMask(uint32 mask) const
void SendClearThreatListOpcode()
void _RegisterAuraEffect(AuraEffect *aurEff, bool apply)
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
uint32 CountPctFromMaxHealth(int32 pct) const
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
float GetMeleeRange(Unit const *target) const
bool isTargetableForAttack(bool checkFakeDeath=true, Unit const *byWho=nullptr) const
float GetStat(Stats stat) const
void SendMeleeAttackStop(Unit *victim=nullptr)
void UpdateSpeed(UnitMoveType mtype, bool forced)
int32 getAttackTimer(WeaponAttackType type) const
void CastDelayedSpellWithPeriodicAmount(Unit *caster, uint32 spellId, AuraType auraType, int32 addAmount, uint8 effectIndex=0)
bool IsControlledByPlayer() const
float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const
void HandleEmoteCommand(uint32 anim_id)
int32 GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
ObjectGuid GetCharmerGUID() const
virtual SpellSchoolMask GetMeleeDamageSchoolMask() const
Minion * GetFirstMinion() const
bool HandleSpellClick(Unit *clicker, int8 seatId=-1)
bool HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura=0) const
bool SetCharmedBy(Unit *charmer, CharmType type, AuraApplication const *aurApp=nullptr)
bool IsAlwaysVisibleFor(WorldObject const *seer) const override
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
void SetPetGUID(ObjectGuid guid)
uint32 getTransForm() const
float GetUnitParryChance() const
bool HasSharedVision() const
virtual bool SetDisableGravity(bool disable, bool packetOnly=false)
Powers getPowerType() const
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=nullptr, uint8 effIndex=MAX_SPELL_EFFECTS)
void SetMaxHealth(uint32 val)
void SetCreatorGUID(ObjectGuid creator)
void GetPartyMembers(std::list< Unit * > &units)
void RemoveAurasByType(AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=nullptr, bool negative=true, bool positive=true)
uint32 GetPower(Powers power) const
uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const
void SendMovementFeatherFall(Player *sendTo)
int32 GetTotalAuraModifier(AuraType auratype) const
uint32 GetMeleeDamageReduction(uint32 damage) const
void SendChangeCurrentVictimOpcode(HostileReference *pHostileReference)
uint32 GetCreatureTypeMask() const
bool InitTamedPet(Pet *pet, uint8 level, uint32 spell_id)
void SetCritterGUID(ObjectGuid guid)
std::list< AuraEffect * > AuraEffectList
void RemoveMovementImpairingAuras(bool withRoot)
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
int32 GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
void GetDispellableAuraList(Unit *caster, uint32 dispelMask, DispelChargesList &dispelList)
VisibleAuraMap m_visibleAuras
uint32 GetCreateMana() const
void RemoveAurasDueToSpellBySteal(uint32 spellId, ObjectGuid casterGUID, Unit *stealer)
void ChangeSeat(int8 seatId, bool next=true)
void GetProcAurasTriggeredOnEvent(std::list< AuraApplication * > &aurasTriggeringProc, std::list< AuraApplication * > *procAuras, ProcEventInfo eventInfo)
void SetInFront(WorldObject const *target)
void ApplyDiminishingAura(DiminishingGroup group, bool apply)
void ApplySpellDispelImmunity(const SpellInfo *spellProto, DispelType type, bool apply)
int32 GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
AuraStateAurasMap m_auraStateAuras
float m_speed_rate[MAX_MOVE_TYPE]
void setPowerType(Powers power)
bool IsAlwaysDetectableFor(WorldObject const *seer) const override
bool IsValidAssistTarget(Unit const *target) const
float m_modSpellHitChance
void TriggerAurasProcOnEvent(CalcDamageInfo &damageInfo)
bool IsImmunedToDamageOrSchool(SpellSchoolMask meleeSchoolMask) const
Guardian * GetGuardianPet() const
uint32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, float TotalMod=0.0f, uint32 stack=1)
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
void SendThreatListUpdate()
virtual void Talk(std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const *target)
bool IsHostileTo(Unit const *unit) const
uint32 SpellHealingBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack=1)
AuraEffectList m_modAuras[TOTAL_AURAS]
void SetStandState(uint8 state)
void _ApplyAuraEffect(Aura *aura, uint8 effIndex)
void RemoveAllMinionsByEntry(uint32 entry)
virtual void Whisper(std::string_view text, Language language, Player *target, bool isBossWhisper=false)
void KnockbackFrom(float x, float y, float speedXY, float speedZ)
int32 GetCurrentSpellCastTime(uint32 spell_id) const
static void HandleSafeUnitPointersOnDelete(Unit *thisUnit)
float CalculateLevelPenalty(SpellInfo const *spellProto) const
void GetAllMinionsByEntry(std::list< Creature * > &Minions, uint32 entry)
bool IsInPartyWith(Unit const *unit) const
static void CalcAbsorbResist(DamageInfo &dmgInfo, bool Splited=false)
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
ObjectGuid m_SummonSlot[MAX_SUMMON_SLOT]
void RemovePointedBy(SafeUnitPointer *sup)
static void DealDamageMods(Unit const *victim, uint32 &damage, uint32 *absorb)
SharedVisionList m_sharedVision
int32 SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask)
bool HasAuraTypeWithMiscvalue(AuraType auratype, int32 miscvalue) const
AuraMap & GetOwnedAuras()
ThreatMgr & getThreatMgr()
float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo *spellProto) const
int32 GetTotalAuraModifierAreaExclusive(AuraType auratype) const
Unit * GetCharmerOrOwnerOrSelf() const
virtual void SetTarget(ObjectGuid=ObjectGuid::Empty)=0
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false)
uint16 m_delayed_unit_relocation_timer
float m_threatModifier[MAX_SPELL_SCHOOL]
void BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, Player *target) const override
virtual bool SetWaterWalking(bool enable, bool packetOnly=false)
void RemoveAllControlled(bool onDeath=false)
bool _IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell, WorldObject const *obj=nullptr) const
float GetWeaponProcChance() const
ObjectGuid GetPetGUID() const
float GetUnitCriticalChance(WeaponAttackType attackType, const Unit *victim) const
bool CanMoveDuringChannel() const
void ExitVehicle(Position const *exitPosition=nullptr)
ObjectGuid GetCharmerOrOwnerGUID() const
void CombatStopWithPets(bool includingCast=false)
bool BuildPacket(WorldPacket *packet)
uint32 GetBlockCount() const
bool GetBit(uint32 index) const
void UnsetBit(uint32 index)
void SetCount(uint32 valuesCount)
void SetBit(uint32 index)
void AppendToPacket(ByteBuffer *data)
bool Execute(uint64 e_time, uint32 p_time) override
Unit * GetBase() const
May be called from scripts.
int8 GetNextEmptySeat(int8 seatId, bool next) const
void Reset(bool evading=false)
void RemovePassenger(Unit *passenger)
VehicleEntry const * GetVehicleInfo() const
bool AddPassenger(Unit *passenger, int8 seatId=-1)
uint32 GetCreatureEntry() const
bool HasEmptySeat(int8 seatId) const
void RelocatePassengers()
void InstallAllAccessories(bool evading)
static uint32 GetGameTimeMS()
What time is it? in ms.
int8 GetTransSeat() const
virtual void SetPhaseMask(uint32 newPhaseMask, bool update)
uint32 GetPhaseMask() const
std::string const & GetName() const
void UpdateAllowedPositionZ(float x, float y, float &z, float *groundZ=nullptr) const
void AddToWorld() override
void RemoveFromWorld() override
virtual void SendMessageToSet(WorldPacket *data, bool self)
InstanceScript * GetInstanceScript() const
virtual bool IsAlwaysDetectableFor(WorldObject const *) const
float GetMapHeight(float x, float y, float z, bool vmap=true, float distanceToSearch=50.0f) const
void SetWorldObject(bool apply)
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
void SetTransport(Transport *t)
float GetTransOffsetX() const
void MovePositionToFirstCollision(Position &pos, float dist, float angle)
LiquidData const & GetLiquidData() const
void GetContactPoint(const WorldObject *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
uint32 GetInstanceId() const
void setActive(bool isActiveObject)
void GetNearPoint(WorldObject const *searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle, float controlZ=0, Position const *startPos=nullptr) const
float GetDistance(const WorldObject *obj) const
float GetTransOffsetY() const
float GetTransOffsetZ() const
virtual bool IsAlwaysVisibleFor(WorldObject const *) const
bool IsWithinLOS(float x, float y, float z, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS) const
bool InSamePhase(WorldObject const *obj) const
virtual void ProcessPositionDataChanged(PositionFullTerrainStatus const &data)
Transport * GetTransport() const
void RemoveFromNotify(uint16 f)
uint32 GetTransTime() const
ZoneScript * GetZoneScript() const
void AddToNotify(uint16 f)
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS) const
float GetTransOffsetO() const
MovementInfo m_movementInfo
bool IsInMap(const WorldObject *obj) const
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
bool CanSeeOrDetect(WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
float GetObjectSize() const
virtual void UpdateObjectVisibility(bool forced=true, bool fromUpdate=false)
void Initialize(uint16 opcode, size_t newres=200)
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
AccountTypes GetSecurity() const
LocaleConstant GetSessionDbLocaleIndex() const
bool HasFlag(uint32 p1=0, uint32 p2=0, uint32 p3=0) const
bool IsEqual(uint32 p1=0, uint32 p2=0, uint32 p3=0) const
spellIdImmunityPredicate(uint32 type)
bool operator()(SpellImmune const &spellImmune)
@ SMSG_FORCE_TURN_RATE_CHANGE
@ MSG_MOVE_SET_SWIM_BACK_SPEED
@ SMSG_FORCE_WALK_SPEED_CHANGE
@ SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE
@ SMSG_PET_ACTION_FEEDBACK
@ SMSG_SPELLORDAMAGE_IMMUNE
@ MSG_MOVE_SET_PITCH_RATE
@ SMSG_FORCE_RUN_SPEED_CHANGE
@ SMSG_SPELLNONMELEEDAMAGELOG
@ SMSG_FORCE_SWIM_BACK_SPEED_CHANGE
@ SMSG_FORCE_RUN_BACK_SPEED_CHANGE
@ SMSG_FORCE_FLIGHT_SPEED_CHANGE
@ SMSG_FORCE_SWIM_SPEED_CHANGE
@ SMSG_PLAYER_VEHICLE_DATA
@ SMSG_HIGHEST_THREAT_UPDATE
@ SMSG_MOVE_SET_COLLISION_HGT
@ SMSG_SPLINE_MOVE_SET_HOVER
@ MSG_MOVE_SET_FLIGHT_SPEED
@ MSG_MOVE_SET_WALK_SPEED
@ MSG_MOVE_SET_SWIM_SPEED
@ MSG_MOVE_SET_FLIGHT_BACK_SPEED
@ SMSG_SPLINE_MOVE_UNROOT
@ SMSG_DURABILITY_DAMAGE_DEATH
@ SMSG_SPLINE_MOVE_FEATHER_FALL
@ SMSG_ATTACKERSTATEUPDATE
@ SMSG_FORCE_PITCH_RATE_CHANGE
@ SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA
@ SMSG_SPLINE_MOVE_WATER_WALK
@ MSG_MOVE_SET_RUN_BACK_SPEED
@ PLAYER_UPDATE_DATA_LEVEL
bool IsGMAccount(uint32 gmlevel)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
bool IsValidMapCoord(float c)
void SendCommand_UInt32Value(T *o, ObjectGuid targetGUID, const char *prefix, uint32 t)
bool IsPathfindingEnabled(const Map *map)
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Pet * GetPet(WorldObject const &, ObjectGuid const guid)
Player * FindPlayer(ObjectGuid const guid)
Creature * GetCreatureOrPetOrVehicle(WorldObject const &, ObjectGuid const)
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Player * GetPlayer(Map const *, ObjectGuid const guid)
if(MSVC) list(APPEND PRIVATE_SOURCES authserver.rc) endif() endif() if(USE_COREPCH) set(PRIVATE_PCH_HEADER PrecompiledHeaders/authPCH.h) endif() GroupSources($
std::string const & GetText(LocaleConstant locale=DEFAULT_LOCALE, uint8 gender=GENDER_MALE, bool forceGender=false) const
MeleeHitOutcome hitOutCome
WeaponAttackType attackType
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
void RemoveStayPosition()
void SetIsCommandFollow(bool val)
void LoadPetActionBar(const std::string &data)
bool AddSpellToActionBar(SpellInfo const *spellInfo, ActiveStates newstate=ACT_DECIDE)
void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
void InitPossessCreateSpells()
void SetIsAtStay(bool val)
void SetPetNumber(uint32 petnumber, bool statwindow)
void SetIsFollowing(bool val)
UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]
void SetIsReturning(bool val)
void SaveStayPosition(bool atCurrentPos)
void InitCharmCreateSpells()
void BuildActionBar(WorldPacket *data)
bool RemoveSpellFromActionBar(uint32 spell_id)
void SetForcedSpell(uint32 id)
void SetSpellAutocast(SpellInfo const *spellInfo, bool state)
void GetStayPosition(float &x, float &y, float &z)
ReactStates _oldReactState
void ToggleCreatureAutocast(SpellInfo const *spellInfo, bool apply)
void SetForcedTargetGUID(ObjectGuid guid=ObjectGuid::Empty)
void InitEmptyActionBar(bool withAttack=true)
void SetIsCommandAttack(bool val)
CharmSpellInfo _charmspells[4]
MeleeHitOutcome hitOutCome
WeaponAttackType attackType
bool IsHostileTo(FactionTemplateEntry const &entry) const
bool IsHostileToPlayers() const
bool IsNeutralToAll() const
bool IsFriendlyTo(FactionTemplateEntry const &entry) const
void generateMoneyLoot(uint32 minAmount, uint32 maxAmount)
bool FillLoot(uint32 lootId, LootStore const &store, Player *lootOwner, bool personal, bool noEmptyError=false, uint16 lootMode=LOOT_MODE_DEFAULT, WorldObject *lootSource=nullptr)
struct MovementInfo::JumpInfo jump
void RemoveMovementFlag(uint32 flag)
struct MovementInfo::TransportInfo transport
bool HasMovementFlag(uint32 flag) const
float GetExactDist2d(const float x, const float y) const
std::string ToString() const
float GetPositionZ() const
float GetOrientation() const
bool HasInArc(float arcangle, const Position *pos, float targetRadius=0.0f) const
bool IsPositionValid() const
void GetSinCos(float x, float y, float &vsin, float &vcos) const
void SetOrientation(float orientation)
float GetPositionX() const
void GetPosition(float &x, float &y) const
float GetPositionY() const
float GetAngle(const Position *pos) const
float GetExactDistSq(float x, float y, float z) const
void Relocate(float x, float y)
ProcTriggeredData(Aura *_aura)
bool operator==(const uint32 spellId) const
std::array< uint32, EFFECT_ALL > triggerSpelId
SpellProcEventEntry const * spellProcEvent
ObjectGuid GetTargetGUID() const
SpellInfo const * spellInfo
AuraEffect const * auraEff
void SetActionAndType(uint32 action, ActiveStates type)
bool IsActionBarForSpell() const
void SetType(ActiveStates type)
void SetAction(uint32 action)